jsBezier ported to closure