creating a singleton config object. taking some code for the observer pattern from jspatterns.com