ADD&MOD: add sorter.py, modify mapper.py and collector.py

Add the sorter to sorts the output of mappers. First the outputs of
each mapper is partially sorted by heap sort in memory. Second, a merge
sortor sorts the outputs of all the mappers based on files.