Added connection retry on startup

@makarski or @dirkaholic can you please review? I'll send a PR to dream to update it to work with this as well.

We need to generate a release / tag out of this when this is merged.