Added client side test structure.
Added unit tests coverage for MainController.
Refactoring and more tests.