Streamline sort_selection.js.