Adds "classes which shouldn't overlap" scheduling check.

For inventory and such.
Sorts things by timeblock in the scheduling checks module.
Fixes query performance of a scheduling check.
A few more scheduling checks query performance fixes.

Still not good, thanks to your friendly neighborhood resources models,
but this cuts out a few more repeated queries.
Minor fix to cache dependencies of hasModule().
Merge pull request #1035 from learning-unlimited/scheduling-checks-fixes

Scheduling checks fixes and upgrades