Adding thread abstraction to be able to test easily (sockets case).  Updated CMakeLists.txt to encorporate test directives.