Adds dependency management functionality to messages.
This includes cycle detection as well as detection
of missing dependencies.