Added TemplateDefHandler. First template is almost working. refs #418