Complete refactoring of routing to move logic to controllers.