DRYing out my IsPrime extensions.