Refactor caching into oa_core.cache.inc