More polygon work, including Jasmine tests.