Fix memory leak in javascript.
Prepare for calculating more accurate directions server-side, and transmitting them in the telemetry packet.