basic model specs and code clean up
Merge branch 'better_test_coverage' into dev

Although I'd like to finish with the milestone of 'better test
coverage', the current changes in this branch are too important not to
include in the dev branch.