User-defined JS objects can be serialised/deserialised properly. This includes Vector2D and Vector3D.
The 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 constructors that take no arguments (all components, Vector2/3 classes). It's more generic than serialising through C++, and would for example likely work well for AI objects or nodder-defined objects.
For objects with constructors that take arguments, the construct call can fail, in which case it reports an error.
Many constructors with arguments would still work, because JS works rather well with undefined values.
This introduces a more elaborate "GetConstructor" function in scriptinterface, which also tries using lexical scope to get closured objects (such as Class definitions). It's a further improvement on rP22487 as that would have failed for Class objects.
Fixes #4698.