Add a function to query a global object, including JS classes, from C++
The latter are not properties of the global object but stored within the global lexical environment.
This is not currently needed, but will be useful for future diffs.
Update Vector2D/3D querying.
Taken from D2746