Use Android's builtin Base64 support.
Simplify some logic.