fix topological sort for undirected graphs
add/fix tests for topological sort
Merge pull request #84 from mlubin/topo

fix topological sort for undirected graphs