Fixed: CPWindows contentView Autoresizes Subviews set in Cib is now honoured

Currently when a window is decoded from a cib, the contentView is set to always auto resize its subviews regardless of the setting in IB.
Fixed: custom CPWindow subclasses breaking flatten.

If a cib file had a custom CPWindow subclass, that cib file would not be properly processed by flatten as it'd fail to find the relevant class (the fact that the class can't be found is an issue in itself). This would cause an exception.

This fix makes CPCibWindowTemplate act similar to CPCibCustomView when the referenced class can't be found: it instantiates a regular CPWindow. This is sufficient for flatten's purposes.
Fixed: -CPImage initWithContentsOfFile:nil created broken image.

Without this fix, code like `[[[CPImage alloc] initWithContentsOfFile:nil] description]` would cause a crash.

This fix makes `[[CPImage alloc] initWithContentsOfFile:nil]` behave like its equivalent in Cocoa: it returns nil without warning or error.
Fixed: appkit_tag_dom_elements support by CPImageView.

Without this fix, the `appkit_tag_dom_elements` flag would only affect CPImageViews unarchived from a coder (e.g. in a collection view, from a cib). It would have no effect on a CPImageView created in code.

This change refactors the _DOMImageElement code to a shared method, reducing redundancy while fixing the bug.
Simplify CPImageView code.
New: appkit_tag_dom_elements now tags with UIDs too.

Tagging with UIDs can make it much easier to debug encoding/decoding related bugs where it's not clear that the right view ended up in the right spot.

The new data attribute is called "data-cappuccino-uid".

Also collect and simplify appkit_tag_dom_elements code a little.
Fixed: previous CPImageView revision not compiling with Rhino.
New: CPString 'compare:' method handles nil and CPNull in correct way

This is the same way as Cocoa works.
Also added test case.
New: Sort using descriptors handles nil and CPNull in correct way

This is the same way as Cocoa works.
Also added test case.
Fixed: in certain degenerate cases, CPTextField may not have a window within _isWithinUsablePlatformRect

Previously, a case could arise where a text field was set as the initial first responder but during cib loading was not yet assigned to a window. In this case _isWithinUsablePlatformRect would fail.

Now _isWithinUsablePlatformRect checks to make sure the text field has a window.
Fixed: CPImageView's _DOMImageElement was not created during initWithCoder.

Previously, _createDOMImageElement was not called until after [super initWithCoder] was called. But that call would end up in CPImageView -setObjectValue, which would attempt to access _DOMImageElement before it had been created.

Now _DOMImageElement is checked before being accessed or created.
Fixed: nib2cib did not allow xibs or images to be in subdirectories of Resources.

Previously, nib2cib would not correctly calculate the app/resource directories if the xib was in a subdirectory of Resources. Also, image resources in subdirectories did not have the subdirectory encoded with the image name.

Now xibs and images may be anywhere under Resources.

Fixes #1960.
Merge pull request #1959 from mrcarlberg/compare_sort_with_null

CPString 'compare:' method and sort using descriptors handles nil and CPNull in correct way
Formatting.

Refs #1959.
Fixed: comparing a CPNumber vs nil or CPNull didn't throw an exception.

In Objective-C, both `[@34 compare:nil]` and `[@34 compare:[CPNull null]]` throw invalid argument exceptions.

This fix makes the same true in Objective-J.

Refs #1959.
Formatting.

Refs #1959.
Test: - CPImage initWithContentsOfFile:nil.
Formatting: @ignore requires /*! comment, whitespace cleanup
Fixed: viewDidHide and viewDidUnhide were not called when being added to/removed from hidden ancestor.

Cocoa specifies that viewDidHide will be called when an unhidden view is added to a view hierarchy with a hidden ancestor view, and viewDidUnhide is called when an unhidden view is removed from a view hierarchy with a hidden ancestor view. This was not the case in Cappuccino.

This commit adds that functionality, and also removes a spurious viewDidHide/viewDidUnhide call that was generated as a side effect in initWithCoder.
Fixed: CPTextField would not become/resign key responder when first responder and unhidden/hidden.

Previously, no attempt was made to become/resign first key responder when a CPTextField was unhidden/hidden. This could lead to a case where a hidden CPTextField was made first responder, then unhidden (and have a focus ring), but would not receive key input.