Correctly serialize/deserialize user-defined JS objects.
Generalize component/AI serialization system to any user-defined JS object. This includes Vector2D/3D, fixing an old issue.
As with components/AI, JS Objects may implement a Serialize/Deserialize function to store custom data instead of the default, which attemps to serialize all enumerable properties.
Fixes #4698
Differential Revision: https://code.wildfiregames.com/D2746