Fixed partitioning logic in Master impl.

- Improved modularization
- Implemented all steps for MapReduce
- Separated Node Callables into classes