Modular exponentiation

Implement Modular exponentiation.
The calls to `clone` here are unnecessary. Can you remove them?