Move template processing substitutions to TemplateProcessor