Key the cache of Transforms using the trajectory.

Fix #303.
Because make_pair moves it, moves it!