Return future objects for all async server and socket functions. Make tests use future.get() instead of arbitrary sleeps.