Changed base64 encode/decode implementation