Add sorting functionality to cmd_notes

- Added sorting to cmd_notes
- Added make_sortable function so that sorts work happily even
  when the disparate notes don't have content of the same types
  in the fields the sort is requested over.
Comply with the case-sensitive rule
Land #1847 - Add sorting functionality to notes command