Utility for sorting object arrays on multiple fields