Add model.js script generation

@raymondfeng @bajtos please review
> Out of curiosity, why this change?

The end to end tests fail since the template outputs code which doesn't use the argument to the exported function (it should not use the argument).