Integrate linear constraints in the SAT solver

For now, it still only works if it can install the latest version of
everything. But this will be an easy change, just by iterating the rhs of the
constraint.

An internal API was changed a little bit. dists is now a dictionary mapping
file names to Package objects (previously it was just a set of file names).