Preferences saving implemented
Merge branch 'preferences-saving'