[core] Revert changes to value of `this` in modules

It seems that the change made to the value of `this` inside module definitions had a bad impact on functional tests. Reverting until I figure out what is failing and why.