Support for reading and writing template files