Progress towards making templates run.
Some code left behind