Close tags that are not "aggregates"

This means closing tags that are immediately followed
by a "value" and have no mentioned closing tag anywhere else
in the file.

I made sure that CDATA tags that can have unescaped <, >, &, and / values are also handled properly.

The details are listed in the commit message.