Support (configurable) retries

Fixes #103