Added methods to modify trees.
Use int for node type instead of string.