Added support for returning the template's output into a variable.