Added anchor support to polygons.

Updated tests.