I ended up cherry-picking different parts from each implementation. I liked David's changes to the read state machine to implement SASL. I used Stephene's implementation of the binary protocol integrated with the ASCII protocol.