Refactoring, basic Socket classes+tests