Cache 1033476

* [x] Add caching of topics too.
* [ ] Make the loading bar disappear at the correct time. Currently it disappears early.

This adds an option for updating the cache if the user doesn't have many documents cached already.

* Many is defined as 5 or less. 
You should collapse this to `<div class="loading" ng-show="loading"></div>`, i.e. all on one line.