This changes a bunch of ivars to __weak's, to avoid reference loops.
Furthermore, in PBGitHistoryController, we need to call [webView close],
otherwise some memory will never be freed?
This changes a lot of code, so quick review:
* RepositoryDocumentController now returns the document without selecting a ref
* PBGitWindowController now optionally shows the default view, or selects no view at all
* PBGitRepository keeps a pointer to its WindowController so that it can change views
This used to be bound to the UserDefaults, but that introduced the
bug that switching the view in one window also switched it in other
open windows.
See 2e7cd5268d