Polygon Near-Linear Triangulation in JavaScript (simple polygons for now)