* Use default arguments when undefined arguments are passed.
* Throw TypeError on first invalid argument
* Accept a number 'encoderOptions' as the quality
* Fall through to image/png if an unsupported encoding is requested
* Return "data:," if the canvas has no pixels
* Lower-case the format before testing for support
Added some argument testing/manipulation to match WebKit/Moz behaviors.
Additionally benchmarked:
* branching on `if (a == 0 || a == 255)`, as it is
* not branching (always doing the alpha calculation)
* Mozilla's implementation found here: https://dxr.mozilla.org/mozilla-central/source/dom/canvas/CanvasRenderingContext2D.cpp#5083
Mozilla's is insignificantly faster (p=0.17) :) so left it as-is.
Progressive jpegs have several very useful advantages over baseline
jpegs:
* Slightly smaller for the same quality (3-7%)
* Load much faster in most browsers.
This adds the `options.progressive` option to the
canvas.jpegCreateStream() function.
When node switched it's build system to GYP then the resulting bin
will be put in "Release" instead of "build". So check for both places with a
little `bindings.js` shim.