First-principles study of silicon nanocrystals: Structural and electronic properties, absorption, emission, and doping