Template class

Almost code based on example code, useful for caching and reusing templates
Merge branch 'TemplateClass' into AllTogether

* TemplateClass:
  Template class