Initial steps to make check_repo Factory agnostic.
Detect staged packages in a more robust way.

Instead of checking the review status of the request to detect
if a package is in a staging project, we use the staging API
knowledge about packages.

This fix the problem that happends when a staged request is
declined and reopened.
Fix tests after changes in pending_requests()
Merge pull request #211 from aplanas/master

Fix a problem found by max. Refactor check_repo to be independent of Factory.