Extract TemplateExtension to remove function registration from Module.