Fix problems with reflecting points computed on the ellipsoid.
Some clean up, added code comments, and reduced number of allocations.
Update the tests.