Exponential-backoff on db failure

Closes #17.