More anchor fixes for metadata pages (rebased onto develop)

Corresponds to gh-473.  Not quite a straightforward rebase, as the last commit is a re-run of the metadata page generation.