Fixed downloading binary files

and Unicode text files.

nsIFileOutputStream inherits from nsIOutputStream
that's method nsIOutputStream#write corrupts binary data
(see note at https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIOutputStream#write%28%29).
That's why ArrayBuffer is used as XmlHttpRequest response type
and then converted to string.

Also javascript functions have limit for arguments set to
65535 that is why is is proccess by slices in the listener.