Add tests and documentation, make ExponentialBackoff side effect free