Encode binary data in Base64

marshal and then use base64 because not all json libs can correctly escape binary data