Simplify fractions (#787)

Simplify fractions (#787)

Reduce a fraction to lowest terms by dividing numerator and denominator by their GCD.