Added ability to write compiled template to file.