Run all gtk pending events only when doing a snapshot
Remove useless setImmediate
Add html method
Add a test for html output