Added support for using template files instead of strings.