Court rules gene patents invalid