Move all data models code back into service.js

The circular require in datamodel.js (with service.js) was breaking the
compilation process and not worth investigation at this time.