Rewrite the C++ coordTransform functions for clarity and to have one properly work in reverse.