Refactor app logic.

Big refactore cleaning up application bootstrap logic.
Controllers are now simpler as the business logic is moved to the notesManager
and the openNotes services.