move the first part of the connection logic into the connection module

You configure the connection by the connectionParameters you pass to the
Connection construcotr. The connect() does not have parameters anymore. There
are still config parameters in the client that belong the connection. It's an
ongoing task.
move connection logic from client to connection