Added better debugging api to visualize tree.