Basic64 javascript encoding