Refactor connection logic in preparation of multiple clients. AH-68
Finished refactoring of server/client connections. AH-68