Added support for PDF attachments (v2)
Added support for PDF file annotations.
Fixed an expression which led to a KeyError for internal links.
Fixed the meta testcase which had no idea of the new attachments entry
Clarified attachment documentation
Replaced unnecessary call to `setattr` with direct assignment
Removed unnecessary PDF output simplification for empty unicode strings
Refactored `write_compressed_file_object` to a top-level function
Use `write_new_object` where applicable in `_write_compressed_file_object` and check that the object numbers are still in sync
Moved imports to top of file
Avoid using the CWD during PDF tests with attachments relative to the document
Refactored the `url_fetcher` argument for `write_pdf` to an attribute of the `Document` class
Added optional filename key to the URL fetcher result
Change filename logic for PDF attachments

This patch honors the filename key of a fetched resource, which can be set by
the `Content-Disposition` or `Content-Type` headers and uses
`mimetypes.guess_extension` for resources that lack any indication of a
filename.
Removed usage of unnecessary `binascii` module in favor of `hexdigest`
Small whitespace fix
Refactored `attachments` attribute from the `HTML` class to an argument for `write_pdf`
Fixed the `default_url_fetcher` for Python 2, which returns a message type with no `get_filename` method
Moved the UTF-8 decoding logic from `compat.py` to `pdf.py`, where it's actually necessary to special case the unquoted result
Replaced `urlopen_contenttype` with `urllib_get_content_type`, `urllib_get_charset` and `urllib_get_filename`.