Added if test to remove and skip templates

Now only calls commentAndMessage if node isn't an element. Calling for
removed attributes was causing errors with where the comment was being
placed.