Cleanup Hubs Implementation

Convert Unit Testing to XCTest
Adds OCMock for unit testing
Fixes Exception when Websockets transport is closed