Fix end-of-snippet
Refactor: separate code to get snippets into a function
Better doc for get_snippet
Refactor: use current_snippet_name instead of current_snippet
Refactor: use constant to denote snippet regexp definition
Move get_snippet to a set of utils