Refector to separate logic from web app routing bits. Moar testing. TDD from now on.