More refactoring in preparation for mapreduce
More code simplification in preparation for mapreduce.
Rename 'piece' to 'reason'