NIO server added.
Various bugfixes and engine logic fixes.