Pure Python implementation of the Ramer-Douglas-Peucker algorithm