Add model.js script generation

@raymondfeng @bajtos please review
Out of curiosity, why this change?