Add cycle tests
Switch from recursion to loop for handler join. Move maybeFatal to core to reuse some internals