Extracted request_setup from request

The work of creating a header from a URI does not need to be in #request
so this reduces the line count of request by quite a bit and makes it
easier to read.

Still, #request is weighed down by lots of exception handling
boilerplate.