Sort arrays by one or multiple calculated keys.