Updates pytree to also accept Node instance instead of nid in some funct...

...ions. This solves a bug in add_node()

I had a bug when using add_node to add a node with a given parent node. The changed functions crashed since a node was given to them instead of an ID. I changed the functions to prevent this from happening again.