More improvements to coordinate transforms, added exception, added unit tests, added command line interface.