Sendlib had its own implementation for base64 encoding, so change it to
make use of the generic one defined in base64.c. While we're at it, move
the B64Chars where it belongs, and remove some global variables by
creating a b64_context structure to hold all necessary information.
- make rfc2047 use generic base64 encode function
This was another source of a custom base64 encode function. Let's keep
the same logic as before: encode 3 bytes (or less) at a time. Also,
switch from a `for` to a `while` loop as `dlen` can simply be used as a
stop condition.