Finally fix orderedActions

  Just use a graph to topologically sort based on the ordering constraints.
It's still not right, as the algorithm isn't resolving conflicts, but at least
it makes temporal sense.