util cleanup; Socket improvements

fixes #23