Cleanup - remove base64 code and use `window.btoa`