Compare parsed and formatted URLs when setting the response
Add more robust cookie handling

In addition to cookies set by resources sent with the Set-Cookie header,
cookies added via scripts on the page will be sent back as Set-Cookie headers.

There is a potential bug in waiting:

While the cookies set on the page can all be retrieved via Phantom's
page.cookies, it incorrectly reports the expiry date for some of the cookies
(if an expiry is assigned to one of the cookies, any session cookies
recieve that expiry value). As such, the decision was made to prefer the
cookies retrieved from the Set-Cookie header of incoming resources. If scripts
on the page update any of these cookie values, the values delivered will be
incorrect, due to the header preference.