Refactor mechanisms to enable strophe.js to be more flexible

I refactored the whole authentication process a bit in order to enable users of strophe.js to easily develop their own auth mechanisms if needed without patching the source code.

Also this enables developers to switch mechanisms on/off on a case-by-case basis, if needed.

The order of which mechanism gets applied first when it's available for the standard SASL mechanisms hasn't been changed. 

Please take a look, comment and if you think this is cool, merge it :)
Btw. One thing to note: I couldn't test Legacy Auth because I didn't find any setting in ejabberd for that. Would be nice if somebody could test it (although I think it should work ;))