Use LinkedDict for nodes, proper mesh disposal

Use LinkedDict to store the nodes instead of an array. Further,
correctly dispose of meshes when removing nodes and edges to prevent
memory leaks.