Refactored `handle_request` function

Moved out some (most really) of the logic into the routing
trait since it just makes more sense there and the code is
a little cleaner and ready for before/after hooks to be added.