Simplify the object iterator API

We were really missing methods to get both the key and the value
in one go.

Change-Id: I996bde79265f45312e68fcc6bdce76704385ea5b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>