Returning array for count, and updated tests

Returning array from getItems means that counting number of items is
correct. I have updated the unit tests to work with the return of an
array rather than only an Iterator object.