added buffer.slice() and some cleanup in NetSocketImpl