Utility for sorting object arrays on multiple properties