sort: refactor compare_fns into Settings
sort: refactor compare_fns into Settings

Also split out a compare_by(a, b, settings) helper function,
which may be used by --merge, later.

kevgeniy/coreutils,uutils/coreutils,Heather/coreutils,kevgeniy/coreutils,tempbottle/coreutils,tempbottle/coreutils,wimh/coreutils,ebfe/coreutils,Arcterus/coreutils,ebfe/coreutils,keunwoo/coreutils,jbcrail/coreutils,Heather/coreutils,wimh/coreutils,keunwoo/coreutils,jbcrail/coreutils,uutils/coreutils,uutils/coreutils,Arcterus/coreutils