Implement ambiguity resolving in the solver.

If we have something like 1 local and M remote, we remove M remote packages
from *install* request and add a single local package to *delete* request
allowing solver to choose the appropriate package.

If we have N remote and 0 locals, then choose the most recent package *or* if
all packages are equal a package from any repository.

For solver prefer newer packages but otherwise prefer packages from the same
repository