Sort consistently before all stat operations

Weighting (if desired) depends on a consistent order between data and
weights, but we were not sorting the new dplyr data frames prior to
running stat operations. Fixed.