Check a tag's full parentage when determining whether it has been

visited previously. This helps in an awkward situation where the same
tag appears twice within a document, under different contexts.

This is one possible fix for #25, don't hesitate to reject if you'd prefer 
something different.