Bug 817535 implementing Mozilla Basket

Rest of the fix

cleaning