Added a Cache interface and user can now provide their own cache implementation for templates