Fixed: when clicking and dragging inside a menu, mouseEntered and mouseExited was mixed up for custom views.
New: @ref and @deref in Objective-J 2.0.
Unit test @ref and @deref.
New: use @ref and @deref instead of Ref.h throughout Cappuccino.
New: optimise CPArray enumerateObjectsWithOptions:usingBlock:.
Fixed: CPNumberFormatter formatted @"" as any number.

Without this fix, `- CPNumberFormatter getObjectValue:forString:errorDescription:` would return `YES` for string @"", like if it was properly converted to an object value, but then actually leave object value unchanged.

With this fix object value is set to nil like in Cocoa.

Refs #1829.
Test: expand CPNumberFormatter test to be more complete.

- Cover the formatting of @"" to nil.
- Check error messages by reference.
- Check output values.
- use @ref() instead of hand coded AT_REF.

Refs #1829.
New: update operators on references, such as `@deref(x)++`.

This fix implements support for both prefix and postfix update operators on a dereference.
Fixed: Using keyboard navigation in empty CPCollectionView threw exception.
New: @deref(<any idempotent expression>).

This change makes it possible to @deref any expression, such as a conditional expression, as long as the expression doesn't have side effects.

The reason not to allow dereferencing of expressions with side effects is that we might need to evaluate the expression twice in certain uses of deref, which is not obvious when you look at the deref operator in plain code.
Formatting: simplify code slightly.
Merge branch 'master' of github.com:cappuccino/cappuccino
CPPredicate: use @ref instead of custom function
Test: refactor token field test to not rely on ivars.

This will make it easier to extend the test with token fields in windows or popovers.
Fixed: transient popover windows would close on mouse interaction with certain controls.

Without this fix, a transient popover would close if the autocomplete menu of a token field contained in it was clicked.

This happened because the popover considered the click to be on a different window. Although not tested, it's likely the same thing would happen if the menu of a combo pop or a pop up button was clicked.

This fix makes it so that any child window of a popover can be clicked without the popover closing.
Test: manual test for most token field behaviour when in a popover.
Test: popovers in attached sheet 2 test.

The popover test now added exposes a bug:

1. Click Modal Window to open a modal window.
2. Click Popover to open a popover.
3. Click on the first window.

It should not be possible to interact with this window since a modal window is open, but a bug in the modal event handling when transient popovers are open will allow the event to incorrectly pass through to the window.

AttachedSheet2 is turning into a complete window/modality/sheets/alerts/popover interaction test.
Fixed: transient popovers broke modal windows.

Without this fix, opening a transient popover would allow windows other than the modal window (or its children) to be interacted with.

In general, setCallback:forNextEventMatchingMask: did not work right if more than 1 callback was installed.

In the popover case the modal window would install its "any event" callback to control the event loop, but then the popover would add a second callback for mouse down to detect clicks outside of it. This would disrupt the modal event handling and allow mouse clicks (and presumably other events) to escape the modal event catcher.

This fix makes multiple nextEvent callbacks work as one would expect, with later ones taking priority over older ones and reinserted callbacks remaining at a stable priority.

This allows the modal window callback to be at the "bottom" of the handler stack and the popover event handler to be "on top" of that, and to remain that way. In theory more layers of event handling could be layered on top such as 2 simultaneous popovers.

This fix also fixes the dequeue argument in forNextEvent callbacks.
CPTableView formatting

Formatting, whitespace and typo correction.
Added doc for -setItemPrototype: explaining how to setup the item prototype when you want to use bindings for the view.