Mg dependencies

Not sure on removing the use of global variables. I would think we'd want to default to global variables and let a user change them to something specific if they wanted to.