CMS-3956 Push server side events to clients using WebSockets.
Refactoring of client code.