make mapreduce a pure map-reduce lib
extract master logic to a dedicated master process