get double buffering up and runnning

This patch enables double buffering with the option "double-buffer". There are
some inconsistencies while drawing things, but generally double buffering works
as expected.