Spectral Classification and Redshift Measurement for the SDSS-III Baryon Oscillation Spectroscopic Survey