Ab initio studies of the atomic and electronic structure of pure and hydrogenated a-Si