* re-factored result-sorting code; debugging stuff still in place (mostly to be removed at next checkin)
Authored by: mukau 2016-11-30
Parent: [r728]
Child: [r730]