Fix for #294

Changes:

- 1-based iteration number is passed as 3rd param to iterator callback (#294)
- Removed the part about breaking iteration from the "should iterate [promise]" test. Breaking iteration is covered by another test.

I made it 1-based instead of 0-based because to me it answers "how many iterations so far?" as opposed to being like an array index. Is this violating principle of least surprise?

Maybe it should be 0-based so it can be passed into key()? Would that even work? Actually, seems like key() is falling out of favor (#281)


I am catching the Error thrown when one of the expects fail and then handing it to mocha. Without the try/catch block mocha's done() never gets called and the test fails due to timeout rather than failing with a "expected foo to be bar" message.

This is a bit of a pain to do but you get more informative test failures.

An issue with the above is the expect() calls done when test data is set up (e.g. lines 138, 141, 145, 148 of test.api.js). I'd argue for those expect() calls and extra getItem() calls to be removed because they

- make async/callback error handling harder
- add visual noise and levels of nesting
- assert about setItem/getItem, and those methods are already tested elsewhere

I will submit an issue/PR sometime next week to explain that a little better.