Try to use the browser Base64 encoding function before

falling back on the included Base64 library
Updated version