Refactor/simplify TemplateProcessor methods.
Add missing Godoc comments, fix various typos