RF-12593: fix hangling of complex types by RenderKitUtils#toScriptArgs

I had to introduce several intermediate methods because otherwise we wouldn't be able to distinguish between following methods and support array arguments `[]` properly:

````
toScriptArgs(Object[]);
toScriptArgs(Object....);
````

`toScriptArgs()` doesn't make sense and we could remove it, since no one uses `#{toScriptArgs()}` with no arguments.

In the commit, I demonstrate how the code may be simplified now.