More refactoring.
Finished cache backend and tests