Tested on linux with X11/wayland and semi-tested on Windows. Windows crashes on item destruction however this is better than nothing. Fix up some win32 build issues on the way with mismatched {} and G_STMT_{START,END}