Note: input numbers must be smaller than 2^24 (16777216). Since the resulting output has twice as many bits, you'll get back numbers that are up to 2^48 (281474976710656). JavaScript can still represent these numbers without losing precision, however, you can't use bitwise operators on these numbers if your input numbers are potentially bigger than 2^15 (32768) because JavaScript only supports bitwise operators on 32 bit signed integers.
morton.code(z, x, y) returns a 48-bit Z-order code.
morton.range(z, x, y) will return an array of the lower and upper bound of the Z-order rectangle. See also Z-order curves in Wikipedia.
[x, y] = morton.reverse(c) reverses c = morton(x, y).
[x, y] = morton.decode(z, c) reverses c = morton.code(z, x, y).