Added cache management to Templates. Added cache prefix to cache keys.