Performance improvements

For `base64`, the slowest part seems to be the actually conversion of the data to base64, which is in the Rust standard library.