Added TemplatePrintToVar, TemplatePrintSmallToVar

These call TemplatePrint and TemplatePrintSmall, respectively, but use
output buffering to return the output as a string variable, rather than
echoing it normally.