Implement double buffering

This factors out code that 'renderToGtk' and 'renderDefault' have in common
into 'renderDoubleBuffered'.
Fix build warnings
Merge pull request #1 from jonashaag/double-buffering

Implement double buffering