associate all temporary edges with a routing context and fix tests.

hand-rebased from three commits in 0.11.x:
b2df28c7ed8bd3107fa53bb368656fc4804ea766...8cafeffbaec796fa5a3f455cce2f0ee22ad4a13c