Adding reduce and tests, refactoring static partitioner
Cosmetics