Added serializing of flags to file. Automatic save on update and loading of stored flags on startup.