Moved client connection code to conn.h