Load gadget dependencies in the right order.