Settings finished.
Little refactoring.
Preparations for moving to SQLite
Merge branch 'djachenko'

* djachenko:
  Preparations for moving to SQLite
  Little refactoring.
  Settings finished.