Rewrite tests, add coverage of `reconnect`