Base64 encoding in node
From https://gist.github.com/Marak/815609#file-base64-js