Refactor: pengine: functionize common ordering tasks
Enhances readability
The only functional difference is that demotes of resources on guest nodes will
now get pe_order_runnable_left when ordered relative to the guest node
connection start (and the container is not failed). It was already used in
comparable situations, and makes sense.