fixes for download saving: doctype, base64-encoding, messages

recreateOriginal() checks for valid doctype object to avoid errors in IE8 and earlier.   Refactored data URI construction into getDataURI() and use base64 encoding instead of URI encoding to fix international character errors when downloading in FireFox (and others?).  Added 'saveByManualDownload' flag to prevent "double message" display when manual download is used as fallback.