Reworked dependency API so that it is much simpler.