Astronomical computations in JavaScript