Move send and recv functionality to sock class.
Merge: amended commit after pushing.