Favor installed providing packages

If none are installed, the first is still selected.
Check if deps are installed before resolving

Makes dependency checking slightly faster because it eliminates some
costly package lookups. Simplifies logic for --absdeps and installing.
Merge pull request #138 from knrafto/local

Check if deps are installed before resolving
Merge pull request #137 from knrafto/providers

Favor installed providing packages
Code cleaning