lib: add modulo.cpp

C++ version of the modulo.h implementation (in fact only a copy of
modulo.c, named as .cpp).