I wrote the basis of a decent julia implementation.  It's in globesFunctions and globesScript.  I still need the function from spatial coordinates to spherical coordinates.  And the script is still just a skeleton.