Overhaul flow construction with several performance improvements

This is a grab bag of performance improvements that significantly improve style recalculation, layout, and painting on a few static pages.

Let me know if you'd like me to split this PR up.

r? @glennw
Should we open a rust bug / add not here to get this added to rust's DList?