exponential backoff implementation (review)

A very basic exponential backoff algorithm that can be plugged into `retry` function. 
Hmm.. this is for the `next_interval` function, right?