Sort an array using any number of separate, ranked criteria