Move url resolving to *before* the request has been prepared.

This resolves issue #193, allowing cookies being matched against the correct (resolved) domain and correctly sent back to the server.
Merge pull request #194 from mjpieters/master

Move url resolving to *before* the request has been prepared.