Would it not make sense to put this in ``utils`` and always order the elements's keys alphabetically (with ``_id`` up front)? I image this can become a problem for other cases as well.