Split repository view from the controller.
Lots of Sonar-inspired cleanup.