refactor(base64): factor out binary string <-> array buffer conversion (#243)