Reorder commands in lib/install-packages.R script to comply with package dependencies