Iteration refactor

This merges iternext() and itervalid() into a single iternext() method returning a <yielded value, boolean> pair. It also introduces a iternext_impl() decorator which makes it easier to populate such pair.
The goal is that object mode performance should at least try to be close to CPython's.  Originally, the object mode is actually faster.  The performance regression is too much here.