Better handling of encoding/decoding Unicode strings.

Perform all socket writes/reads in binary mode, and only decode/encode
when transmitting metadata to/from socket. This ensures that the contents
of the file itself are transmitted completely verbatim.

This also fixes a hang which would occur if a file on the remote system
included CR+LF line endings.
Merge pull request #26 from codeman38/unicodefix

Better handling of encoding/decoding Unicode strings.