[js] Fix exposing for integrated runtimes

Integrated JavaScript runtimes oftent don't (and probably don't need to) have such things like "window", "exports", "console" etc. So this fix is intented to use "this" object whenever other options are not available. "this" will always be defined and will refer to the parent scope, since we use a self calling function here to expose haxe classes.