Porting Google's S2 Geometry Library to Javascript