snippets: move snippet code into src/snippets directory.

This helps separate some of the reusable snippets code from the rest of
the editor. Might be nice to merge this with some other projects long
term.