added method Tree.map, added test cases for select_all, select_first, for_each, map