Infrastructure for per-phase tests, with inline source as a string.

And a sample test.