updated socket read write to nonblocking to allow for ssl.
Merge pull request #14 from tyro89/master

updated socket read write to nonblocking to allow for ssl.
Fix some tests.