Collect connection instances in the containment hierarchy - fixes #464
Added unit test