Uses unsigned values, new Iterator class

The previous versions were not ready for more than 2^31 or 2^63 items
in an array, due to its use of signed longs, but the new version uses
unsigned values. It was tested in unsigned shorts with arrays greater
than 32768 to make sure the math is correct.

Also added an Iterator class to cut down on the repetitive decimal_step
logic.