An adaptive method of lines solution of the Korteweg-de Vries equation