Added automatic loading of dependencies

Change-Id: I59a4c209e36608ccef34ba646c002a6de853f0e2
(cherry picked from commit 66d52ee6ba8e7ab342a92ade6ed8154867bccc26)