Cleanup and fixes to modularize data model and serivces.