Sort the JSONObject before importing using a TreeMap so accounts are restored to the account database in the correct order.