Add log and remove some global vars.
Another global bites the dust
Move configmanager initialization