Tidy up stream test harness & fix race conditions
flake8 fails with F821 for unicode under python 3.4.2
Merge pull request #432 from leth/fix_test_race

Tidy up stream test harness & fix race conditions
Merge pull request #435 from dims/fix-flake8-issues

flake8 fails with F821 for unicode under python 3.4.2
return the socket on execute