Add attachment filename to html-version title

#337, #1281

The `<title>` tag was defaulting to the URL of the file, rather than a
nicely presented title.