pack all templatescripts into template.js with document.write()