Make Base64 encoder tail recursive.