Split out request handling to allow for dynamic registration of handlers.