make it run with Go 1.1
improve error handling
poll timeout
Merge pull request #1 from gmarik/master

Make it run with latest Go