Added runtime and compile time modular exponentiation function.