Implemented bstree_traverse(), and a helper function
subtree_traverse() that applies a function to each value in the tree.