More work making TemplateDefs available to templates. refs #500