[FLINK-1053] Cleanup implementation of mapPartition function

This closes #42