Use setImmediate to start new call stack

This fixes "Maximum call stack size exceeded errors" when compiling thousands of templates.