Add tests that build modules for our builtin headers, and fix two buglets exposed by doing so.