Changes to reduce functions to support dtype kwargs.
Add tests for reduce functions kwargs.

Also speeds up some slow tests.