Fix binary data encoding in js generator

Binary data type should preserve binary (8-bit) encoding, instead of treating it the same as utf8 strings.