HTML/EPUB footnotes:  Put `<sup>` tag inside `<a>` tags.

This allows better control of formatting, since the `<a>`
tags have a distinguishing class.

Closes #1049.
LaTeX writer: Properly escape pdftitle, pdfauthor.

Closes #1059.