Some various changes, mainly rewriting things to GMP