Begin rewrite of template tests as individual tests.

This adds the basic infrastructure for #23768 and ports over the basic
syntax and include tests.
Rewrote rest of template tests as unittests.