Add modular arithmetic library.