cleanup_cache spec
slight refactoring for memory store
a rather strange solution to increase test coverage for memory store: logic in cache cleanup thread