Changed so index queries and all-node queries use Iterator instead of Iterable

This makes index queries and all-nodes queries lazy and less memory intensive