protocol: remove [Type_at] and improve [Type_enclosing]

Note: at this point, the emacs mode is broken.