minor refactoring of Graph
uses os.path utilities for path manipulation. Closes issue 4