1040101: Avoid repeating work and database lookups checking modifies

Flatten out the algorithm, and only query the database once for entitlements
and once for products
Merge pull request #509 from candlepin/ckozak/bind_perf

Ckozak/bind perf