Add some debugging primitives
Start porting tests to countdown latch