theme chooser: fix an occasional segfault when reloading themes.  Also,
some cleanup of unused code