Transliteration of C++ Douglas-Peucker implementation
Change it to use datamaps-style input and output instead
Split datamaps-style coordinate lists into coordinate pairs
And the opposite, to rejoin pairs of coordinates into a list.