Spaces of Homomorphisms and Group Cohomology