Make `connect()` invoke authentication, make tests more explicit, add more tests.