Keep slices as a map in Threads class

This makes it easier to later define a slice as a subgraph of a
series-parallel graph G instead of merely a path in G.