Derandomizing homomorphism testing in general groups