Google Maps API gives me a distance of 1034km. You just converted the coordinates wrong.
Your code:
var home = ['London', new google.maps.LatLng(-0.1167, 51.5)];
Correct coordinates for London:
var home = ['London', new google.maps.LatLng(51.5, -0.1167)];
The same applies for the other points in your example. Hope this helps!