Security fix: sanity check for template and jsonp parameter.
Security fix: Limit stack depth of the parser.