Revamping of the Tree class: added all of Marco's functionality.