Fixing reflow across multiple pages

And added tests to prove the reflow