How a 'basket case' oil refinery in Newfoundland came out on top