Bug fixes.
Adding callback for websockets handshake protocol, in order to enable define custom logic in hanshake, for example auth.
Fixes.
Documentation fixes.
1. Changes to JSON protocol. 2. Optimization fixes. 3. Refactoring.