Changed template processing to utilize any function

Defaults to default templates, but should allow any template engine,
such as Handlebars, to process templates instead.