update package installation code

Packages can now be installed with a handy function. I also started to
move the installation of some packages to where I configure them.