Polished XYZTranslator and its tests.

Reorganized the code, filled in some docs, made comments clear, improved the
tests significantly. Basically, this is done.