Implement ddoc qualified anchors for template members

Fixes [issue 10366] (https://issues.dlang.org/show_bug.cgi?id=10366).

Existing ddoc test results have also been updated (by hand -- to verify they are what is expected) to have qualified anchor names.
Nit: it's a little weird to have braces for the else-condition but none for the if-condition.