In oldIE dom nodes don't have hasOwnProperty
Rename tag.if to tag.when as if is a reserved word in oldIE