Added AppPreferences class, remembers last username.