Base64 encode payloads for the sake of javascript