Add model.js script generation

@raymondfeng @bajtos please review
Good idea. Cached at require time.