Templates for cache implementation. Incomplete. Just a draft.