ML-33 Refactor how configuration is passed around modules

Done might be some other currently unused stuff that needs to be fixed up