WIP: complete split of packages.js into three files.
Doesn't run yet.
Simplify checkUpToDate handling