Refactored model/db interaction slightly. 13 passing tests.