England had a dream day with bat and ball as they put themselves in complete control on day two of their final Test against South Africa.