Fixing `array.keySort()` when it's passed variable shaped `Objects`

- Modified `array.keySort()` to generate a more robust Function