fixed destructuring assign in global context. Updated tests. cf #883
merge from destructuring values branch