Changed socket to be a class attribute. Added client unit tests.