Integrate 'val' into the template engine.  We have somewhat working if, loops, and simple outputs for now.

Most of the unsupported features should error out now, but some remain that will work in the future and produce broken code for now.