Updated networking to use NIO

Embed code.