Add ability to use templates for file generation - first try