Update $4p_template.js

add data reference and toString() for templateData