Allow hue, chroma or saturation to be undefined.

In HSL space, grayscale colors can now have undefined hue rather than assuming a
hue of 0°; likewise black and white can have undefined saturation rather than
assuming 0%. In HCL space, black can now have undefined hue and chroma. (For
non-black grayscale colors, including white, hue and chroma are implied by the
D65 standard referent.)

When interpolating between colors with undefined hue, saturation or chroma, the
defined value is used when available. For example, when interpolating from black
to blue in HCL space, the intermediate colors are now dark blues (#241178)
rather than dark purples (#600054).

Fixes #833.
Remove duplicate code.
Select the document element, not the document.

Fixes #1219.
Fix #1220 #1218 re. d3.select and d3.selectAll.

This commit fixes d3.select so that it no longer propagates data from the
document element to the selected node when a selector is used. This commit also
fixes d3.select and d3.selectAll such that the returned selection’s group’s
parent node is set to the document element.
Formatting.
Fix #993; d3.geom.hull is now ccw.
Pull conditional out of inner loop.
Add package.json prerequisites.
Merge branch 'time' into 3.1.6
Merge branch 'fix-select' into 3.1.6
Merge branch 'convex-hull' into 3.1.6
Merge branch 'grayscale' into 3.1.6
Merge branch '3.1.6'
Saturation is only undefined for black and white.
Fix null transform attribute warning in Firefox.

Strictly speaking, the transform attribute should never be set to null;
it should be set to "translate(0)" for the identity transform, or it
should be removed using removeAttribute("transform").

Setting this attribute to null causes a warning to appear in Firefox:

  "Unexpected value null parsing transform attribute."

This occurs when using d3.transform(null), e.g. to interpolate to or
from a non-existent transform attribute (null).

This fix checks whether the value is null, and if so, returns an
identity transform.
Fix projection.clipExtent regression.

A bug was introduced in fa514dd08c9a6ac11e177da6051a76efe291d5ea, where
invisible line segments were incorrectly drawn.

Thanks to @jfirebaugh of iD for spotting it!
d3.geo.bounds: antimeridian and inflection points.

The behaviour of d3.geo.bounds has been modified slightly, such that the
minimum and maximum longitudes denote minimum and maximum meridians when
going from left to right in a standard equirectangular projection.

If the maximum longitude is in fact numerically smaller than the
meridian, this simply means that the bounds cross the antimeridian.

This fixes several issues:

* The bounding box is now a true minimum-width bounding box.
* Line segments that cross the antimeridian are now correctly handled.
* Similarly, polygons that cross the antimeridian are now correctly
  handled.

Secondly, inflection points are now detected, so that the latitudinal
range is extended in the case where the great arc contains the great
circle’s inflection point.

Lastly, support for polygons has been improved, e.g. those that wind
around the poles, and those that have a counter-clockwise winding order.

Note that as part of the winding order detection, the performance of
d3.geo.area had to be reduced somewhat (by as much as 25%).  This is
because the trick to avoid atan2 calls fails for winding order detection
in the case where a counter-clockwise area strays into a positive
quadrant.  We can reinstate the trick for area-only calculations in
future; I think correct winding order detection is more important at the
moment.

See #1154.
Tweak version generation.

Instead of relying on sed to replace a VERSION token, we generate
src/start.js, which defines the internal `d3` variable with the current
version derived from package.json.

In addition, all file generators (component, locale, start) have been
moved to bin/.
Remove redundant VERSION from test sandbox.

This is no longer needed due to
22b744b7e60122bee5abb82642ecb4feefa873d0.
Fix time tests by adding Date to sandbox.

Since tests are now run in their own sandbox, assert.deepEqual was not
properly testing the returned Date objects for equality, as they weren't
instances of the same Date class used by the test itself, causing type
inference to fail.  It was always returning true, even for different
dates.