initial import, incl. extracted parts from sema lib as new trio.core ns