Enhancements for sub-assemblies, separate templates and updated tests

you could also use `path.extname(fileName)`