[Fix #541] Improve assertions of documentation tests

Collect all documented variables, and compare them against the list of
known variables _once_.  That makes it easier to understand what's going
on.