[Macros] Adapt to macro API changes and switch more testing to use it.
The API provided by macro evaluation has changed a bit. Adapt ASTGen to
the new API, and use this as an opportunity to start moving more tests
to using the shared libraries built into the toolchain.