Rework SASL subsystem to make it multi-mechanism

This commit takes the existing SASL code and refactors it such that defining
additional mechanisms should be simpler.

New mechansisms should implement the SASLManager.Mechanism interface, and
should be "pure" - in as much as the Base64 encoding is handled for them by
the SASLManager itself.

With this patch, only the existing PLAIN mechanism is a new-style Mechanism,
the existing ANONYMOUS code is left alone (in part because of existing deployed
bugs in ANONYMOUS handling), and no new mechanisms are added.