js templates: Fix problem generating code for projects with dependencies

Change-Id: I481574bcf9c9a163b28493d6f1c740b68bd04fcf
js templates: Cleanup

Change-Id: I465885ceefbd1fb22ba1c9803af534cb8115a7f9