Begin rewrite of template tests as individual tests.

This is part of #23768 and ports over the basic syntax and include tests.
Other tests can be ported in separate commits for easier review.