Adding modular arithmetic module

This is a translation of Perl5's Math::ModInt