adds base64 decoding (fixes #5656)

fixes #5656
Does this mean that a whole array needs to be allocated for every 4 bytes? That seems unlikely to have good performance.