Add new macros for structure wrapping. Wrap most of windowsettings.

- add new macros to make it easier to wrap structures into python objects
- convert the old wrapping functions to use these new macros
- make wrap_windowsettings wrap most of the windowsettings structure
- add a CMake option to enable a workaround for python's circular GC
  clearing our dictionary while we're building it
- make the workarounds enabled by default