Added defensive code for null vertices.
Changed edge collapse code so that it rewrites the IDs on collapsed edges
so that they don't collide with one another. This ensures that collapsed
representations retain their connections to all neighbors. Fixes bug SPC-791.