Correct generation of dual polygons
Fix JSHint and delete redundant code