Add pry as a development dependency for debugging.
WIP for better error management.

- This code could be simplified. Should use a closure to keep track
of retries rather than an object.