Fixed the haversine formula to calculate distance between 2 points

Fixed formula and added bdd tests, as referenced here: https://github.com/strongloop/loopback/issues/904