Added websockets support. Bug fixes.