Updated NodeType, and added more (de)serialization code.