Bezier Cruves - De Casteljau's algorithm in JavaScript