Port integer-gmp to use static closures.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>