Order units by priority as well

Signed-off-by: Michal Čihař <michal@cihar.com>