CodeMirror textarea is initialized correctly

Changed isAddingSnippet to isAdding
Move functionality to ‘snippet’ directive
Added the language mode to the server’s ‘snippet’ model