Depcheck improvements

Improvements to dependency checking. Still a work in progress but ready for initial review and comments. cc @julen

    This allows a more decentralized approach to dependency checking where each
    module is responsible for its dependency checks.
    The non-core dependencies still need to be ported in a later commit.
    
    Note that this has a mild performance impact and this logic should only run
    once per instance startup.
The naming is confusing, `test_dependencies()` is generic and it could mean required, optional, optimal, whatever. This would be fine if this module will be reduced to this function, but it's hard to tell from a half-cooked patch.