Performance improvements

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