Allow retries and timeout to be configurable.

This allows the retries and timeouts to be configurable. I also removed the `Kernel.sleep` as it shouldn't be necessary IMO.