Add search functionality to note

Also tweak new and edit commands to delete/restore note if the file
is empty.