Spin-based quantum-information processing with semiconductor quantum dots and cavity QED