Report all dep check errors at once, add dep check unit tests

Sadly dep checking becomes more complicated to understand, but it allows us to report multiple errors by removing erroring modules and continuing to the next stage of checking.

As compensation, I've added some dep checking unit tests. They're a little fragile (because they depend on hidden properties) but robustness will have to wait until I can isolate things properly.