Changed preferences to use JSONArray for serializing. Closes #7