better handling of socket connections. Tests run on mac
tests should run on 0.8 fixes #28