Implement diagramming of eight-queens.py.

Also fix some bugs that diagramming uncovered.