first pass at compiling and rendering templates