Replace Function->Callable in sum, prod, ...

Implements suggested change to fix #7663, allows to use a constructor in reductions, not as reduction operator, but as function that is applied before the reduction.