Added gcd, extended gcd, and mod inverse functions