Code remodeling

Move all helper funcs to model.js
Add dataReq for expression data
Code cleanup