Added logic to ensure connections can be started and stopped repeatedly without error.

- Also added logic to ensure that calling start multiple times works correctly

#1873
Added a fail function to the QUnit extensions

- Essentially is QUnit.ok(false, message)
Added tests to verify correct functionality of starting/stopping connections repeatedly.

- Also added tests that verify everything works when starting/stopping with odd timings.

#1873
Addressed code review comments