Optimize cojade compilation and usage, #6

Still seems slower than vanilla by about 1-2ms on my netbook,
but that's fine. It's more annoying to pass in functions to the
templates though.;wq;