Wherein I try, not for the first time, to refactor http://search.cpan.org/~mjd/txt2slides/