macosx: Fix issues with opening library views correctly
The behaviour on app init in master has a number of bugs that lead to incorrect views being opened in the library window.
This MR refactors much of the code handling the opening of library views to remove hacks and duplication and ensuring the correct views are presented, even as the library model is initialised and updated
Example of bug -- a table view being presented where a collection view should be:
Signed-off-by: Claudio Cambra developer@claudiocambra.com