Allow overriding the source for templates

While the default is still to load it from a file, this now allows
for other sources of the templates.