Use Montgomery multiplications in scalar inverses

Based on #77.