Rewritten the system pull scripts

Rewritten the system pull scripts to make dynamic installation of the
dependencies more robust.