Simplify the code to create low-level server/client connection

Now all the state needed for creating a connection is in a record