Adds primality testing code.