Added account preferences and login/logout logic.