Various network fixes

Various network fixes:

* Perform vectored I/O when sending (saves 40 bytes on the wire per datagram!)
* Enable TCP_NODELAY and tcp keepalive.
* Fix #122 
* Fix #121