Cleaned up code and finished basic unit test coverage for all controllers and factories