pkgsummary.py: Add decorator to morph exceptions

Let's try a decorator to morph exceptions for some simple functions.
It's about the same amount of code overall, the functions are
simplified, and there is only one try block now.
piuparts-report.py: Refactor global summary

Move the sector precendence sorting to another function.