trees.pl: Removed some unused variables
balanced_tree.py: Finished the algorithm, added a bunch of tests