Updated many parts of the script to Valve's code

Everything raid/lvm related hasn't been changed, everything else has been updated to what is in the latest post_install.sh from Valve.