Refactor NotesController and list notes in sidebar.