bookmarks: save bookmark metadata as bookmarks are modified and fix several defects
continuation of !31 (closed)
Fixes #55 source mark iterator skipping source marks at first line of buffer.
while looping through iterator missed first nonoccurence as it has already moved to next mark.
fix is to use do-while loop instead while loop
Fixes #56
bookmark set to last line is not restored. total lines calculated from buffer was 0-indexed hence boundary condition was wrong. made minor fix.