Removes old code that is no longer used.
Reorganizes Tree class for clarity.