Change the `tree_map` and `tree_filter` methods in `Tree` and its subclasses to return new objects rather than modifying in place. 