change to using directed graphs

the self transition probabilites are treated as loop edges
add script to run all tests

Also clean up the code a bit
rename graph_from_nodes to kmcgraph_from_nodes

also, add node loop edges if not already present