refactored the unit test framework for better synchrony and added the ability to stub out io.sockets