Add Polygon utility class ; small code-style and jslint changes