simple implementation of Euclid's algo for gcd in Python and Javascript