make scheduler state dump more human friendly. fix #27.
handle unexpected_idle in test.c in different ways depending whether we've backtracked or not.