basic opt-in replication - retry

at the moment it is opt-in because I wanted to test it without all the other replication breaking, it has an element of randomness so that if multiple clients all lose connections at the same time they will not all attempt to reestablish it at the same time.