Scientists have found a way to pick the best pacemaker for each patient, potentially making them last years longer.