[WIP] add support for secondary indexes

If you do this iteration in _put, then you could avoid passing in the batch array. Pure code (without side effects like appending to an array) is typically easier to understand & test.