Add href, basename, mimetype, and ext attributes for media elements.

Also move the external and internal media-tag generating into a single (new) method, for ease of maintenance.

I have been using this plugin for generating PDFs with the XSLFO plugin, and would like to be able to use these new attributes in XSL stylesheets.