Common minimal multiples and divisors for rational matrix functions