clean up util, take a look at tests
fix tests, add stubs for test_socket, test_config, test_has_clients, test_has_sessions, remove duplicate code for testing sessions