Massive cleanups. Move functions from Template to Core.
Some operators now use functions "the right way".
Compile related templates lazily.