Add support for template, with, as bindings

This translates partials and with scoping to TAssembly, and forwards the 'as'
aliasing mechanism for foreach.