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