Oh!  Turns out when atom reordering occurs, the residues may need to be
reordered as well. So add functionality to sort residues and atoms within
residues as well.