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.
Yes, test_dependencies will be for all types of dependencies. Notice that they return one additional argument: the dependency "priority", meaning whether it's required, optional etc. So it's done in the `__dependencies__` module now.