Share the code for calling static method between GIRStruct and GIRObject by putting it in function.cc. Also fix the debug printing such that it correctly prints "Gtk.Window.function", not "Gtk.function".
Will hopefully help users and developers to debug conversion problems more easily. For now prints .toString() of the JS object and the GITypeTag of the expected data. In the future the exception could output the GType information.
Shortens the method considerably making it easier to read. Also keep scope of declared variables to a minimum, and make use of const where applicable.