Base64 class from upstream

- [x] @joemukai