Recognizing geometric 3-manifold groups using the word problem