Refactors greatestCommonDivisor to one line

There's no need for all of that code for gcd. Euclids algorithm could be defined recursively