Methods to know if a node is root or leaf

This PR adds a couple of methods:
`node.root?` returns true if node is a root (no parent)
`node.leaf?` returns true if node is a leaf (no children)