3783: sorting lists of edges in prufer.

Fixed some unpythonic syntax, and returning a sorted list of edges.  This deals with issue 3783.