Added bit6.on() interface to register bit6 notifications
replaced existing mechanism of listening to the document notifications,
fixed chat window update,
reindent on index.js file (most of the diff caused by that).