Refactors MortonCode.

Faster and cleaner implementation. Better unit tests.
Improved documentation.