Add ability to retry on caught exceptions

This commit adds the infrastructure for being able to retry
based on caught exceptions.

In order to do this, the retry interface has been extended to
include either the http response or the caught exception.

For the time being, all we retry is requests.ConnectionError.
If after retrying the appropriate amount of times we still
get an exception, then the exception is propogated.