Tests for HTTP redirect following.
Use RestClient internally for redirect following.

The main difficulties here stemmed from the way the logging code
is interleaved throughout the code and had to be passed around
between methods, which doesn't work with RestClient's more
exception-based handling of HTTP error codes. Also, some chunky
refactoring because Net::HTTP lets you modify a request object
before sending it, while RestClient implements this as arguments
to the Request#execute method.

There's also quite a lot of weirdness around the do_raw_request
method, which works differently from do_json_request in that it
ignores any HTTP error codes and returns the body of the response.
Since there aren't any tests, I can't tell whether this was the
intended behaviour, but since the only use I know of for this is
fetching KML data from Imminence, which we no longer do, I'm not
so worried about breaking backwards compatibility in error cases.
Merge pull request #40 from alphagov/handle-redirects

Follow redirects