Add possibility to define the file extension

In some scenario you may want to have the possibility to define the file extension for the output. e.g. if you want to compile javascript template to .js files.