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.

Fixes #649
```%x``` expects ```unsigned int```. Could you add the right cast here? See ```man 3 printf```

>  o, u, x, X      The unsigned int argument is converted to unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal (x and X) notation.  The letters abcdef are used for x conversions; the letters ABCDEF are used for X conversions.  The  precision,  if  any, gives the minimum number of digits that must appear; if the converted value requires fewer digits, it is padded on the left with zeros.  The default precision is 1.  When 0 is printed with an explicit precision  0,  the output is empty.