exponential backoff implementation (review)

A very basic exponential backoff algorithm that can be plugged into `retry` function.