Ensures that dependencies have at least as high priority as dependents

This recursively passes priorities down to dependents so if task A depends on task B, task B must have at least as high a priority as A. This avoids situations where extremely high priority tasks only end up running after all the low-priority tasks have finished because it depends on the one that runs last.
I think it could make sense to move the priority updating to `self.prune` and run it every few seconds.