Cache the results of base64dec

This does not help as much as the previous commits, but it shaves another
40% off execution time.