Allow subclasses of Vertex and Edge

Don't check for class equality, but inheritance. The old equality check made inheritance impossible (e.g. for ScalaVertex). IMHO we could just drop the two lines altogether (31/32) because the compiler verifies that it's an Element.
Merge pull request #88 from mpollmeier/patch-1

Allow subclasses of Vertex and Edge