class Graph refactored so that now it uses Node and Edge classes

Implementation based on nested combination of pair- and vector-
templates was refactored. Now graph contains a collection of Nodes, each
of which is a collection of Edges. Code is more legible now. The
interface of Graph class did not changed.  Refactored class passes all
the tests.