Remove extraneous & for call by reference in document upload plugin.  Call by reference should be handled in the function signature, not a runtime.
Removed passes-by-reference from document templates download.
Hard coded some MIME types for document template download in case mime type detection is not supported.