Created unit tests for models. Still need to fix problems in models caught by tests and create functional tests