Added modulus, exponentiation by squaring, and modular exponentiation by squaring functions