Rework tcp data buffering

Test files refactored into single file