Centralized client socket code.
Improved network code exception handling.
Added node state enumeration.