Compositional game theory