Generalized Morton to parameterize it on on a value type, rather than Bool.