Implement foldMapM - a fold for accumulating a monoid inside a monad