Refactor to allow incremental drawing

Appending 20,000 or more spans in one tick tends to kill browsers, the
drawing code will now draw incrementally at configurable increments.