Fix tests and expose a few more gmp functions

(Those are useful for cryptographic purposes.)