Cache lookups of LocalSites in the API unit tests.
Review Request #6084 — Created July 8, 2014 and submitted
We fetch LocalSites quite a lot in the API unit tests. This attempts to
reduce the number of queries by caching and returning them after they've
already been queried once.
Unit tests pass.