Fix broken code with new EP construction.

The last commit was incomplete and broke some things. 'ep' is no longer a key on the nodes in the graph, and some functions were still using it. Those have been fixed.

Also fixed an oversight in the relabeling of nodes, where the attributes could specify nodeids (e.g. for 'iv' and 'bv'), so those are now manually updated when relabeling.

Things aren't perfect, but this commit should fix much of what's broken.