data-sort: generalize to support sorting of multiple bases