Surface properties, adsorption, and phase transitions with a dispersion-corrected density functional