Added tests of multithread behavior

I have included the contents of the itiu fork due to its support for the newest jzmq/elastic search.

The bulk of this work is a refactor of the tests to allow asynchronous and multithread-asynchronous testing.