Added a basic graph implementation. Not tested yet, but made it generic.