Add sorting to make package generation consistent across runs
Cleanup Package ordering

Now packages have a total order, and they only compare equal if they are
equal.
Clear the Resolve cache in each test
Remove no longer relevant comment
Some cleanups and tests for the eq generation code