Fixes an issue where the metadata markup language namespace (md:http://cnx.rice.edu/mdml) isdefined twice, once in the document tag and again in the metadata tag. This fix may not be an all around solution, but seems to work enough to import documents with this problem.
Bailout if the resource file is missing.
Some resource files are included in the document more than once, so filter them by filename.
This may not be the final solution, since the mime-type appears to be allowed to change in some instances. What those instances are is unknown to me.