Moved functionality from controller to view
Finished controller unit tests.