add sort(A,dim), sortrows, and sortcols. closes #2484