Peer reconnect

Actually turned out to be quite complicated to do this right.