fix caching bug. for #22

also switch tests from FakeCache to CacheDict