Add API_EXPORTs for iterator API

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Don't double-increment iterator depth

When we enter a sub-value in an iterator, we were incrementing the depth
counter twice. We now increment only once.

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Add test cases for iterators

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
Print errors when REQUIRE fails

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>