Unify format order selection

Calculate the format order centrally in YoutubeDL.py

This commit is a snapshot for backup reasons. We can apply some the changes directly, and will need a big PR that flips the switch for all IEs.