Implemented mapping of functions, and tree traversal.