Add Preferences dialog and Settings class.