Dar 1724 - chat rail module optimization

Don't merge it yet, it still needs to be QAed.
I've moved the chat rail module rendering to JS, PHP code is just providing cached data about users connected to chat. Previously the whole rendering was done in PHP and was taking about 2%-5% of the total server time.