Clean up and simplify rev_compare_tree()