add cachedBy, like cached but adds a key

re-factored to a base implementation with
no Yesod dependencies in TypeCache.hs
Is there a good reason to expose this? I'd rather keep it hidden if possible, in case we decide to play with internals in the future.