Refactor dependency installation script. Add gcc and bzip2 dependency.