Refactored and redesigned the tree classes to separate out the tree and node.