GUI: Clean up creation of GUIs, hopefully fixing the crash-on-destroy this time.
The control/container hierarchy has been flattened, and a single stack is now
used to create both controls and containers, which helps with objects that
are essentially both (notebook container in particular). Also, the new code
is shorter and less kludgey.
Also, the control/container C++ object destruction is called from the widget's
destroy handler, instead of the other way around. This required explicit
removal of the controls in gui_cleanup, to avoid widgets lingering past the
lifetime of their finalize method.