Ben Stokes scored the second fastest double century in tests on the second day of the second test against South Africa by battering the home attack to take England to 513 for five.