Directly read a few instance variables

This is instead of going through ‘self’ and was done to harmonize the code. Since two of the three variables are C++ types we cannot use dot syntax (self.property) when we wish to call a member function on the result, but using [self property] is ugly and would require us to then also use [self setProperty:value] (for consistency), hence why I went with direct access.

Since the selectedTabIndex property is closely related to documents and selectedDocument, I applied the same changes to this property.
Ensure all methods can handle a missing document

This fixes a crash bug when menu validation is invoked before the controller has set up a document. Hardening the other methods is just a precaution (as we generally shouldn’t make assumptions about the state of public properties.
Ensure ‘self’ is kept retained

This shouldn’t be necessary, as we have a ‘retainedSelf’ instance variable that isn’t cleared until ‘[self.window close]’ (the last line of the accept: method), nonetheless I am seeing (rare) crashes from this method, and it appears to be reading the ‘self.window’ property in the last line, so adding this extra safety and will monitor crash reports.
Remove all but the default bundle index

The other bundle sources have been merged into the default index.
Auto-hide the text view’s scroll bars

This is for users who have set “show scroll bars” to “always” (or auto and am using a mouse).

Closes #527.
Add to existing content view instead of replacing it

The window border drawing seems to be done by the root content view so it’s best to keep it around (as it may also do other things that we are unaware of).
Don’t mark parent views as opaque

The reason for this is that NSTextField will draw itself in the “faded” state (for non-key windows) unless some of its parent views are marked opaque.

The previous problem with not having the parent views opaque (see da3a91a7bb224900d9cca6530ebbc6dfedd5d381) seems to have been solved by setting the autohidesScrollers property to YES.
Don’t set gradient view as opaque

This is so that a potential NSTextField will correctly render itself as inactive when using NSBackgroundStyleRaised.
Post “directory did change” notifications

This is both to speedup file browser updates (as there is a bit of lag waiting for fs-events) and to work with file systems that doesn’t support fs-events (issue #745).
Let directory data source observe the “did change” notification

This means we instantly reload after performing a file system operation.
Reference ‘self’ instead of asking for singleton

In theory we could be calling this method on the non-default file manager.
Handle case changes on insensitive file systems

NSFileManager only provide a move function which fails with “file exists” if we make case changes on a case-insensitive file system, therefor we now explicitly test for that error and use <x-man-page://2/rename> if the source and destination refer to the same file, but the path differ.

Fixes #769.