Guzzle 4.x compatibility

These changes refactor the client and internal APIs to be compatible with GuzzleHTTP 4.x

The public client API isn't far off being backward compatible with current master branch, but there are some incompatible changes.

This will need to be released as a new major version.