Introduce generic way to create pairs.

This commit introduces a generic way to create pairs of conduits. I'll ask @snoyberg maybe it's reasonable to move some parts of this functionality to another package.