Added check for existence of code-folding-gutter before attempting to access its textContent. This should fix issue #4. Refactored out CodeMirror folding function