Improve Origin handling in Client

This change makes the Origin comply with rfc 6454, in that it is now scheme://hostname[:port], in lieu of full url.  

Also allows overriding of default Origin with an Origin header in the headers parameter to constructor.

Thank you.