Folding with Monoids: foldable trees