Refactor, making timeout configurable
Improve reliability of socket spec

It seems that pushing to the array in #send (from the worker's thread)
was not thread-safe, and sometimes the array looked empty to the main
test thread.
Words