Macro api improvements

Exposes the typed AST to macros. Do we want this?