Append .count to anchors with the same qualified symbol name

Don't write anchors for matching ditto symbols. This helps to avoid
renumbering subsequent anchor overloads when adding a ditto item.
Matching symbols with a ditto comment don't need anchors so much
because they are near a closely-related anchor.
Add getEponymousParentTemplate function
Merge pull request #3862 from ntrel/unique-anchors

Fix Issue 9728 - Ddoc anchors non-unique across overloads
minor refactor to improve comments and error recovery
Merge pull request #4071 from WalterBright/exp-refactor

minor refactor to improve comments and error recovery