SQL style asc/desc sorting of arrays of objects on multiple keys