Renamed 'cookie' to 'preference' to use localStorage instead of a cookie for distance_units