untangle common connection setup
simple socket setup, make testing simpler
working reconnection logic
Merge pull request #43 from leapmotion/cleanup_connection

Cleanup connection