a sketch of reconnect functionality
added tests for reconnecting, refactored a little
Merge branch 'mysql-multimaster' of github.com:meetings/gearsloth into mysql-multimaster