Clean up clamped-reduce.

We return a reducing function that can be used with the usual reduce
instead of reimplementing reduce.

Also cleaned up some whitespace.