Legislation to restrict jury trials for all but the most serious cases has passed its first major Commons hurdle - despite a rebellion by some Labour MPs.