Merge in stuff from MS cocos2d-x branch