fixes for download saving

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