Add support to "reduce" a tree and remove specific items.