[core] Fix value of `this` inside ES6 module definitions
Merge branch 'es6-context' into dev-master