Optimizing some queries in the TreeBehavior
Disallowing the creation of tree cycles in the TreeBehavior
Cleaning up and adding doc blocks
More cleaning up and doc blocks