Add protocol tests

And more

Signed-off-by: Jack Huey kitskub@gmail.com
Merge pull request #2212 from kitskub/client-connection

Add protocol tests