Polyfill for browsers which don't provide window.btoa and window.atob