see if you can separate some of it into own functions.

for example the [stanza parsing part](https://github.com/DevAlien/node-xmpp-server/blob/e10c7ce27a72849b5c6023296a20e53b01778eae/lib/c2s/stream.js#L125-142) could be put into a `onAuthStanza` function.