US, China put aside differences for pledge to work together on climate change