Fixed setting synchronization issue

Moved default settings to CSMSettings::UserSettings.
Other minor code changes / cleanup
Fixed segfault opening tables
Merge remote-tracking branch 'graffy76/RefIdTypeDelegate'