Return a proper Point object in stringExtent().
Corrected iteration when building up the path.
Use black as stroke and blue as fill style (temporarily).
Close the path when drawing a polygon.