Update tree.rb for customizable print tree

I needed some customizable code to print a tree and the default print_tree code was a perfect starting point.
The default is to render as before this patch

example of use:
````
tree.root_node.print_tree 0, method(:print_node)
def print_node(node, prefix)
  # your code
end
````

As I'm not a expert, comments and advices are welcome.