Improve debug logging to have header/footer, move recursive description into its own file
Add missing call to restore graphics state