layout: Implement incremental reflow.

See commit messages for details. I had to fix a nasty iteration issue with generated content and an issue in how `FlowList` removes elements in order to get this working. Along the way, I refactored some code and improved debugging; these commits are separated out.

r? @SimonSapin (or whoever would like to review it)