Fix streamutil.readAll() corrupting non-UTF 8 data

Use Buffer.toString() explicitly and specify the encoding as binary
to avoid corrupting the data when reading from the buffer
under Node
Fix http_client not following redirects under Node

Header names are lower-cased
Extract date conversion functions out of lib/onepass for re-use elsewhere
Log diagnostic output if image data type cannot be determined

Also mark SiteInfoService.update() as private as it is not intended
for external use.
Add utility method for extracting the suffix of a string following the last occurrence of a delimiter
Base64-encode message (plain|cipher)text in messages with the key agent

The messages sent to the key agent were JSON but the
plaintext/ciphertext were binary strings. This happened to work in the past
because they were being UTF-8 encoded when sent and UTF-8 decoded when
received. Following the fix in streamutil.readAll() to decode as binary
this broke.

Use base64 encoding as the standard way to exchange binary data in JSON
messages.
Output better debug info if decoding a fetched image fails

Include the bitmap info header size, which indicates the image's type
and also a hex representation of the first few bytes of an image
which fails to decode.
Fix decoding failure in lib/siteinfo/service_test

The fake HTTP server set up for the test was UTF-8-encoding the binary
data written in the response but binary-decoding it on the client side.
Use binary encoding on both ends.