sort by batch if monoid is commutative
Merge pull request #410 from singhala/sort_by_batch

sort by batch if monoid is commutative