Adding Graph class and tests.