Sorting json keys while updating index.txt

Sorting keys to ensure key order doesn't generate a new index.txt without need.