add more tests, break out connect to main module, more improvements to client class