minor refactoring
better elementMax and elementMin for general arrays
Extra testing for edge cases
extra testing
more tests
Support for long count in RepeatedElementIterator