Move the factories for managing the cache in common.js