Fix a few bugs, add tests and specific exceptions.

All still relating to the SASLManager changes before. Main bug here was
forgetting to have implemented the <challenge/> handling, since it's not
really used for PLAIN anyway.