geom_polygon: make sure id is a factor/numeric

polygonGrob requires that `id` is numeric, but the value passed to it,
munched$group, was sometimes a character vector. Converting to a factor
ensures that it's numeric.
Add visual tests for stat_density2d
Update NEWS
Fix position_dodge example. Fixes #755
Merge pull request #771 from wch/fix-polygon

Fix polygon grouping bug
Draw only one set of logticks, and don't use aesthetics from data. Fixes #767
Update NEWS