Fix iterator moving backwards and created unit test for the JniDBIterator

Iterator follows the following principles
1) Always points to a correct item, unless empty
2) Almost always points to the item to be returned next
3) Except when the last item has been returned. atEnd is set to true at that time and the functions work correctly when the last item has been returned (and the iterator would become invalidated)