Move GetClosestApproach and supporting methods into JUtil.

Also fixed a bug with timeAtClosestApproach, and removed some debug prints that I had missed.