Update next() method to throw for incorrect state. Add more tests for Iterable.
Support generator over cursor.