Switch to JSON files for persistent data

Run migrate.py to convert an existing config.sqlite to the new format.