Added rem_f, gcdinv_f, invmod_f, xgcd_f.