Rapid Formation of Icy Super-Earths and the Cores of Gas Giant Planets