implement secondary sort: sorting by values in addition to keys

see:
https://issues.apache.org/jira/browse/SPARK-3655

this is the first of 2 competing pullreqs that try to address this issue. this one does so by modifying spark internal sort routines to support sorting by (key, value) pairs in general, instead of just by key. this is the most "invasive" solution, in that it makes (small) changes to many core functions. but if we think there are other parts of spark that can also benefit of this new sorting capability (besides PairRDDFunctions.PairsfoldLeft which is part of this pullreq) then this could be the appropriate change.