Refactoring 'array.keySort()' to be 'safe'

- Handles variable shape records in a DataStore, or user errors