Started work on test coverage
- Currently incomplete because some view helpers are hard to mock properly.
Refactored for better granularity.