The California-Kepler Survey. IV. Metal-rich Stars Host a Greater Diversity of Planets