Decouples socket operations from socket implementation.

TODO: Implement the Node socket operations, and
either change the expectations of readForever or
translate the data returned by Node into what
readForever expects.

TODO: Make sure that the env detection stuff
actually works!