Errors fixed and new features

Fixed the problem with the bold snippet.
Added the ability to enclose the selected text into the text snippet.
Created function for creating snippet objects