Code cleanup/refactoring and documentation throughout

* Introduce singleton and utilize it
* Improve setting of global variables
* Introduce ba_eas_install(). Adds options to reduce extraneous db calls, for now.
* Update uninstall routine for new option