This is an attempt at fixing #4698,User-defined JS objects can be serialised/deserialised properly. This includes Vector2D and Vector3D. This requires those objects to have a "default" constructor, i.e. though different from what was tried beforethat the can be constructed like so: `new Thing()`.
Objects with default prototypes can be serialised/deserialised along with their prototypeThe approach I take is not via serialization into C++ (and thus via EngineScriptsConversions), but by simply re-constructing the object. This works well because basically all of our objects have default-constructors (i.e. constructors that work with 0 arguments). It's more generic than serialising through C++, which fixes issues such as Vector2D Serializationand would for example likely work well for AI objects or nodder-defined objects.
----
This also uses lexical scope to access "Class",introduces a more elaborate "GetConstructor" function in scriptinterface, which also tries using lexical scope to get closured objects (such as Class definitions). since those are not properties of the globalIt's a further improvement on rP22487 as that would have failed for Class objects.
----
This did not play too nice with components who use their own system in a weird way.
I don't understand why it doesn't work for variables in the same file as test_vector. Probably some scoping issue? @Krinkle if you happen to have an idea. Or perhaps I'm just not using the correct script interface for the global objectFixes #4698.