Fix preservation of passage order in Twee

This includes the changes from #129 as well: since the modified lines are very close together, you'd probably get merge conflicts if I didn't include both commits.