add basic test for adding a single edge; fix memory leak in FreeGraph()