Tightening up some more code, moving config around to be accessible by plugins as well as internally