ENH+FIX: refactor the way we load in the database and initialize the app. this lets us test it easier but has some kinks still