Simplify backoff code.
Add backoff test.