Preserve passage order in Twee output

See discussion at: http://twinery.org/forum/index.php/topic,1450.0.html

This pull request includes the commits from #123 as well since it depends on them; only the last commit is new.