ws: Add support for Chunked Transfer Encoding.

supported for chunked transfer encoding and added/updated related test cases.
fixed some typos and a potential bug.
format adjustments.

Fixes #649