Foldable summary functions

I suggest changing the sum function for quantities to be defined in terms of `Foldable` instead of `[]`.

I also suggest adding a `mean` function. The proposed implementation is a little bit confusing, but it does only do one fold. I'm not sure whether some dark magic would optimize the conceptually simpler definition in terms of `sum` and `dimensionlessLength`, and I don't know how to check.