Only access superglobals in a single place

This ensures that the only superglobal usage is *before* dispatching, allowing dispatching to be used for internal routing.