encoding/decoding to/from binary string in javascript.