(PUP-2794) Modify the shared spec for iterative functions
This updates the shared tests for iterative functions to also
be capable of handling reduce. This also adds missing tests
that were part of one of the individual tests earlier.
The test for reduce now also invokes the shared behavior for argument
checking.