mp_integer: implement serialization.