Minor refactoring to simplify other changes.

Move adding the value to the build to a separate step, only fetch
the majorkey in one place.

This makes it easier to modify the value if needed.

Change-Id: I360ec3351f3dd4af285d463d58cade004a3c1099
Actually instantiate the templater in the test for this.

Change-Id: Iaff45e30427bf32653e0bac6a3d1d197a7285313
Introduce a helper for constructing the item under test.

This will make it possible to tweak it for all tests in a simple manner.

Change-Id: Ib328cecf4046dd0a19469e2bdbfc1d47f68ad624
Add a mechanism to escape tagged template blocks.

By adding a colon (:) to the start of the braced block, the block's
value is marked as 'safe', and doesn't need escaping. For the moment,
the escaping function doesn't actually do anything.

Change-Id: Ib09b84dd5ed4671ac8cc2b1f97116e7aaab92796