Fix codemirror tab issues and add self-closing braces