Make client.Request more testable, break coupling with RESTClient

Moves polling to a function provided by the RESTClient, not innate
to Request. Moves doRequest from RESTClient to Request for clarity.
Add test coverage and fix a few minor problems
Merge pull request #2047 from smarterclayton/make_request_testable

Make client.Request/RESTClient more testable and fakeable