Change the way Connection / EM are created in tests