Simple script which transforms distances array into JSON object (adds location info retrieved from Google Maps and uses cache to decrease external calls).