Fixed config loading so that's easier to migrate to OSGi.