Fix edge indexing problem when modifying graph
This fixes a rather central bug, which causes duplicated indexes if edges are removed and then new ones are added. Edge indexes are now recycled as they are removed and then new ones are added. This still guarantees O(1) complexity when adding or removing edges.
Showing with 18 additions and 4 deletions