added javascript templates and new generator structure, new -ext script option