add more methods to the code generator

this adds variadic function calling and for-loop generation to the code
generator
add a template validator helper
initial cut at template instantiations

still needs work