Moved compare and format functions from tree to node.