Transforming bitmaps into vector graphics: a port of Peter Selinger's potrace in javascript