Add model.js script generation

@raymondfeng @bajtos please review