safety checks for template rendering during publish
another safety check for listen elements
cleanup and attributes in publish output
Merge pull request #189 from secretrobotron/publish-safety-checks

safety checks for template rendering during publish