Don't split tags of bookmarks if not needed.

Removed the string splitting of the bookmark tags when they are read from
file. Implemented the tag matching without the use of extra allocated memory.
Fixed memory leak in prev next pattern validation.