Modular exponentiation: (this ^ exp) mod m, via right-to-left square-and-multiply. Equivalent to boost's powm(base, exp, mod).
powm(base, exp, mod)