Clean up caching and add tests.

TODO:

- [x] Add item caching tests
- [x] Allow the cache to be disabled with `settings.CACHE`