Simple long-polling utility which follows the HTML5 Websockets API