Added some config file code, its untested.