Tests for lastgenre (cleaned up)

This new PR supersedes #717. It contains only the refactoring and new tests. I also restored the min_weight option, which was lost in one of the refactoring commits.

Does this look mostly good, @KraYmer? Looks like we have one failing test, which I'm guessing was the whole goal of this exercise in the first place. :smiley: