sasl base64 encode decode fix

This fix make encode/decode work and adds a test case too.