Added some error checking

Added some error checking functions, for example, to make sure there
were no un-used variables in either the template or the variables file.
 Also, added some code to ignore comment lines from the variables file,
and modified which characters were variable delimiters.