Allow typedefs and template definitions in the shell
Fix tag dispatching in the formatter