App init loads the database and preferences.