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. 
See my notes above. In particular, your mistake here is that on line 32 you need to `return Promise.all(docs.map(...))`. Since the .then doesn't return a promise, the Promise library has no reason to wait on anything.

Promises aren't magic. Just creating them doesn't cause things to wait. In this case,the .then on line 32 is returning a value (a list of strings here), not a Promise, so the next .then is called immediately.

You'll probably have to re-work this function a bit to get the data flow you want, since your `.then` functions must return Promises if you expect the next step to wait for those Promises to finish.