Added unit test for long string and bug fixes.

* Long negotiate commands are packed and unpacked correctly.
* Added unit test for packing and unpacking long string.