Client constructor now takes a Socket object instead of a location, and rewrote tests