Refactored tree and treeSet out of newick module.