Improved tests.

Added model, controller, and integration tests.
Merge branch 'improve_tests'