Add Graph class, fixed errors in test graph init