Updated networking to use NIO

This is the new input listener.