sort multiple sort-only elements correctly

fixes: http://manage.dimagi.com/default.asp?77485

(still pending a locale strings issue)