Base64 encoding/decoding in pure JS