add printDebug method for debugging templates
Merge remote-tracking branch 'upstream/master'