Refactor PreferencesStore and IniStore

refs #5682
Rewrite preference DbStore

refs #5682
Merge branch 'bugfix/preference-dbstore-broken-5682'

fixes #5682