Fixing JSON to preserve order of lists and dictionaries