Faster TreeNode#is_root?
Cache node_depth for improved performance
Fixed bug raised in #37 discussion
Merge pull request #37 from aidansteele/master

Performance optimisations