JS encoding/decoding

Test in progress