Bring over py-int work from gmp-removal branch