Adding reduce and tests, refactoring static partitioner
Cosmetics
Merge remote-tracking branch 'upstream/n3960' into n3960