Enhancements to the python script

-Use strip instead of removing last char from line, helps when last line of input file isn't terminated with a carriage return
-Set search path to the python script path and the current dir
-Remove path prefixes from template file variables
-Put generated files in appropriate directory tree