Merge pull request #283 from hwhw/master

Fix some funky behaviour
refresh queuing

This replaces the wait-for-refresh (or "update") logic with a
queue that tracks the updates and will wait only for those updates
that cover overlapping sections with an update newly scheduled.

Adds some debugging output, too.