Pass ga reference into module factory

This avoids the assumption of a global ga reference. Should make it a little easier to mock the GA object in the tests.