(core) Fix fragments/object conversion rules

Improve stability of the network editor: Avoid desynchronizations
between serialized network and diagram, due to the order of vertices in
the network. Each kind of vertex is now referenced by its own index in
the network.

Fix #122