Working on rearchitecting Client connection library

Initial commit of this piece.