Implement Curves tool

The Adjustments -> Curves tool is now fully operational, by which I mean
the tool performs the following tasks:

1) A curve is rendered in real-time
2) New nodes can be added
3) Existing nodes can be moved
4) Nodes can be removed by right-clicking them
5) Curve values are exported to a param-compatible string, then passed
to the core "Apply Curve" function (making this tool fully
macro-compatible, despite its complexity).
6) The curve's effect on the image is previewed in real-time
7) The curve can be applied to the image by pressing OK.

Note that the actual Curve operation is fully optimized via look-up
tables, making it damn fast.

There are a number of UI things left to accomplish (better node
rendering, including hover support, background histogram, etc), but I
wanted to at least post this functional code.

For future reference, this tool has a surprising number of edge cases
that must be handled - for example, adding new control nodes in certain
locations can cause many DBZ errors.  I believe all such cases are
handled correctly, and if someone can crash the tool I would be very
surprised.

Finally, a theoretical "unlimited" number of nodes are allowed, but
duplicate nodes will be automatically deleted once the number of nodes
matches the number of horizontal pixels in the curve tool (as two nodes
cannot share the same x-value).  I do not foresee this being a
problem...lol.