(test) Testing for setting and parsing cookies.

This includes fixes for tests found to be failing:
- The &mut [u8] meant to hold the hash was not sized.
- Json was not handled correctly, resulting in extra %22 (`"`) characters, amongst other issues.
- Extension headers were malformed.