Implement Ctrl-\ as hook

Misc cleanup