Better cache key generation

All of the arguments supplied to the request function can impact what is
returned by a restful service.

This takes account of that and makes the cache key more specific,
including basic auth details, so we don't rely on *just* the absolute
URL for caching.

Also removed some redundant code, if it doesn't work with SSL_VERIFYPEER off the first time, it won't work
the next time.
RestfulService_Response now gets response headers

Before now, the RestfulService_Response object was never sent the
response headers. For APIs that rely on the response headers to send
back information (signatures, pagination info, etc).

This change makes the curl response have the full HTTP response
(including Headers). We then extract the body and the header information
and assign them to relevant vars and then construct the response as
before (with the addition of the headers array).

This change required two new functions:
extractResponse: This extracts the HTTP Headers and the payload from the
curl response and assigns it to the relevany vars that are passed by
reference
parseRawHeaders: This was designed to mimic http_parse_headers (a
non-standard php class). It converts the headers into an associative
array.

Passing tests

We were having a test failure due to the change in the way cachekeys
were generated.

The ResfulServiceTest had the logic for generating the cachepath hard
coded in the test class, so this has been pulled into a function on
RestfulService, allowing it to be changed in one place and remain
consistent.

Naming and visibility changes

Changing the name of static methods to make them inline with SS
standards as well as declaring method visibility on all functions

Error responses now get a cached response

When an request errors, a cachedBody gets included, this is now replaced
by a cached response object, so the headers and other info can be
accessed.

The old functions still work and remain.

Tests updated to allow testing of private methods

NEW: Testing restful service http header parsing

Created a test for http header parsing

BUG xpath_one doesn't check if var exists

Var not set error thrown when xpath_one is used on an xml response that doesnt match the xpath, this fixes that

Fixing typo

Cleanup

Changes as per @chillu's (sensible) requests
Adding default curl options

Because I removed completely the static setting of SSL_VERIFYPEER I've
added the ability to declare default curl options on the class. This
means that users that really want to one line turn off SSL_VERIFYPEER
can do so without needing to pass a custom option in every request()
call.