Base64 encode manually

1.8 has no Base64.urlsafe_encode64 method