Write powMod(base, exp, mod) that returns (base ** exp) % mod without ever building the huge power. All three arguments and the result are BigInt values.
base and exp are non-negative, and mod is at least 1- Use the halving idea from fast exponentiation, reducing modulo
mod after every multiplication exp can be as large as 10n ** 18n, so the loop or recursion must run about log2(exp) times- Products of two residues do not fit in a plain number, which is why BigInt is required
- Anything to the power
0n is 1n modulo mod, and every result modulo 1n is 0n