Refactor graph code. Querying to build a Top Packages graph.