Adds a retry_if option to the retry middleware

retry_if allows users to provide a block that
will receive the env and exception objects
and should decide if the call should be retried
or not.

Fixes #298.
Includes an idempotent_methods option to retry middleware

This allows users to provide a list of methods that
should be assumed to be itempotent. The default
list contains HTTP's default idempotent methods
but it allows overriding in case a client would
like to use other custom HTTP methods and also
declare them to be retryable.

If the method is included in this list the `retry_if`
block is never called.