relay: cleanup and fix a couple of bugs

* change the way disconnections are performed
* lookup channels disregarding case - channels have to be non-case unique