Refactored controllers and updated tests.
Updated script to run the tests.