High-redshift Galaxies: the Far-infrared and Sub-millimeter View