rewrite `iter_payday_events()` and increase its test coverage
Merge pull request #2573 from gittip/more-history-tests

Simplify iter_payday_events and increase its test coverage