added function to create directories for a file if it does not exist
added new method for checking if a file is a template file using a single line headder