settings: replace and update modes;
log wifi changes;
reading events errors are logged to separate table (prevents explosion);
main activity refreshes when returns from preferences;
tables indexes recreated on db upgrade;
JsonMap reformats inner json objects from string;
small refactorings;