Initial implementation of template compiler.