make inspection of collections derived from connections possible by
adding  `__dir__` method.

factor out utility functions