Cowboys beat Giants 36-31 in wild season opener