Refactored bep_app and generate_dre_file so that the database writes take place in the app.  The updates therefore show up immediately.  SQLAlchemy sessions are not thread safe or safe to use within other processes