Simplify collapse + its test.
Simplified call interface + testing for collapse/reduce.