Spin coherence and optical properties of alkali-metal atoms in solid parahydrogen