Get rid of globals in getgraph by packaging vars in a struct.  Resolves issue #62.