Fix two bugs in projection stream caching.

The cached stream must be invalidated when the precision changes, and when the
context is changed.
Fix another bug in projection stream caching.
Add area-weighted geographic polygon centroids.

This generalises the centre of mass formula given in:

  J. E. Brock, The Inertia Tensor for a Spherical Triangle,
  J. Applied Mechanics 42, 239 (1975)

In addition, centroids of zero-extent features now fall back to the
centroid of the feature treated as a lower dimension, i.e. polygons →
lines → points.

Specifically, if the centroid of a polygon or multipolygon feature is
ambiguous, it will treat it as a set of lines.  Similarly (but not
exactly the same), if a line or set of lines has zero length, it will be
treated as a set of points.

This also applies to d3.geo.path.centroid, except that the fallback
always occurs if the feature has zero extent (area or length).  For
geographic polygons, it was simpler to fall back if the centroid was
undefined, as area is not tracked in a simple fashion.

Fixes #1011.

Optimised d3_acos, and used d3_asin and d3_acos where appropriate
instead of Math.min and Math.max.
Remove spurious dependency.
Don’t invalidate when precision changes.

The stream doesn’t capture the current value of the precision, so there’s no
reason to invalidate the stream when the precision changes. This partially
reverts commit 9a2fb5817efb414a7945a45429d11845954b91af.
Add missing import. Fixes #1292.
Use relative error for intersections. Fixes #1075.
Merge pull request #1294 from mbostock/pack

Use relative error for intersections. Fixes #1075.
Fix comment.
Optimise d3.geo.resample.

This avoids recreating closures for handling polygon rings, which was
causing the V8 JIT to recompile them.
Use point-in-polygon test for winding order.

This point-in-polygon algorithm uses the same area calculation as
d3.geo.area, inlined for performance.

Fixes #1300.
Add support for parsing weekdays and week numbers.

Also includes support for parsing "%" literals.
Remove a couple of comments that no longer apply.
Use additional precision for accumulating area.

This uses double the available floating point precision, so that
small floating point errors do not accumulate too quickly.

Fixes #1305.
Optimize d3_geo_accumulator.
Shave a few bytes.
Fix #1311 - more robust tick insertion.
Rename d3_geo_accumulator to d3_adder.

It’s not strictly geo-specific, so math seems like a reasonable place for it.
Use user-select: none instead of preventDefault.

The use of preventDefault while dragging or zooming was preventing
desirable defaults from being triggered.  Using user-select: none is a
less intrusive way to prevent text from being selected.

If user-select or a vendor-prefixed user-select is not supported, we
suppress the selectstart event instead (for IE9).

Note that Firefox has a bug where absolutely-positioned elements do not
inherit the -moz-user-select style from the body element, so users may
wish to additionally set -moz-user-select: none on absolutely-positioned
elements, at least until this bug is fixed:

  https://bugzilla.mozilla.org/show_bug.cgi?id=648624

Fixes #1288, #1099.
Add pack.radius for explicit radius.

Fixes #857. By default, the radius of each circle in the pack layout is derived
from the square root of the node’s value, which is then scaled according to the
bounding box of all circles and the layout’s size. By specifying a radius
function, you can now explictly control the radius, disabling automatic scaling.

The radius function takes the value as input and returns the corresponding
radius. If no radius function is specified, automatic scaling is enabled; this
is the default. Conveniently, d3.scale.sqrt can be used as a radius function.