Improve the GCD/LCM implementations
Use a faster variant of the Euclid's algorithm to compute the greatest common divisor.
Use a better variant of the least common multiple computation that implicitly avoids overflows.