Harmonic analysis and discontinuous groups in weakly symmetric Riemannian spaces with applications to Dirichlet series