Add nodeClass parameter to Trees, so they can instantiate the correct TreeNode type. Add RBTreeNode.toJSON().