Why not have a number that begins at 0 and ends at 16777215?

Incrementing it is a matter of adding 1. Figuring out if you're out of addresses is just a bounds check. 'packing' the address is a matter of ORing with 0xF0000000 (and then performing an unsigned right shift of 0 (`>>> 0`) because that the OR will flip the sign bit of the address, and JavaScript is weird).