Refactores gather-read and scatter-write

The header_data_type is now unknown to the
socket scructure.
Can `bytes_transferred` ever exceed the size of user_buffers? If not, then we can simply use it instead of `length`.