Update base.py

Went to a Miller-Rabin primality testing algorithm over the Fermat algorithm.