Add unit-testing framework (ct based)
Use unit-testing in travis CI
Add debug stubs
Stop waiters when exiting the wait loop

This attempts to prevent a late wake-upper from trying to wakeup the already
woken up waiter.
Add tests for wire_wait