Three-manifolds, virtual homology, and group determinants