Optimize common subexpressions in Montgomery multiplication

The hottest loop in the library.
Consistently shaves 5s off a test suite run.

Again, thanks to @daira.