Refactor eval_tree debug code.

This just pulls the eval_tree debug message generation into one place.