Add get_note_id_from_line function.

Same code was used in multiple places in memo.c. Function was added to
prevent duplication.

Signed-off-by: Niko Rosvall <niko@ideabyte.net>
Implement note id reordering.

With command line option -O Memo now can reorder note id codes. For
example: if there's notes with id codes 1,3 and 5, running memo -O will
reorder them to this: 1,2,3.

Signed-off-by: Niko Rosvall <niko@ideabyte.net>