Added support for raw template and template caching, updated tests