Merge pull request #2211 from kitskub/client-connection

Numerous fixes and such
Merge pull request #2212 from kitskub/client-connection

Add protocol tests
Initialize client's session

Signed-off-by: Jack Huey kitskub@gmail.com