Preload data in background thread

- Add "factory" for categories and friends.
- Refactors Categories and Friends view controllers to utilize factories.
- Build and insert temporary activities when actions occur, thus making the UI feel snappier.
- Slight and various refactoring in random places.