Add tree traversals and tests.