Refactor script.

Also, add a function to determine if the retransmissions follow an exponential
backoff model.