SCRAM mechanism selection tested.
Added tests and fixed bug in SCRAM