diff --git a/config/install/yamlform.yamlform.contact.yml b/config/install/yamlform.yamlform.contact.yml
index 1be3ec4..d10aadb 100644
--- a/config/install/yamlform.yamlform.contact.yml
+++ b/config/install/yamlform.yamlform.contact.yml
@@ -94,7 +94,7 @@ handlers:
       from_mail: default
       from_name: default
       subject: '[yamlform-submission:values:subject:value]'
-      body: '[yamlform-submission:values:subject:value]'
+      body: '[yamlform-submission:values:message:value]'
       excluded_inputs: {  }
       html: true
       attachments: false
@@ -110,7 +110,7 @@ handlers:
       from_mail: '[yamlform-submission:values:email:value]'
       from_name: '[yamlform-submission:values:name:value]'
       subject: '[yamlform-submission:values:subject:value]'
-      body: '[yamlform-submission:values:subject:value]'
+      body: '[yamlform-submission:values:message:value]'
       excluded_inputs: {  }
       html: true
       attachments: false
diff --git a/config/install/yamlform.yamlform.example_inputs_extras.yml b/config/install/yamlform.yamlform.example_inputs_extras.yml
index 2e94634..d230425 100644
--- a/config/install/yamlform.yamlform.example_inputs_extras.yml
+++ b/config/install/yamlform.yamlform.example_inputs_extras.yml
@@ -19,6 +19,22 @@ inputs: |
       '#title': 'Private input'
       '#description': 'Add <code>#private: true</code> property to an element to only show the element to users with results access.'
       '#private': true
+  codemirror_elements:
+    '#type': details
+    '#title': 'CodeMiror Elements'
+    '#open': true
+    codemirror_text:
+      '#type': codemirror
+      '#mode': text
+      '#title': 'Text'
+    codemirror_yaml:
+      '#type': codemirror
+      '#mode': yaml
+      '#title': 'YAML'
+    codemirror_html:
+      '#type': codemirror
+      '#mode': html
+      '#title': 'HTML'
   contrib_elements:
     '#type': details
     '#title': 'Contrib Elements'
diff --git a/config/install/yamlform.yamlform.example_wizard.yml b/config/install/yamlform.yamlform.example_wizard.yml
index a0f6fd6..15b98eb 100644
--- a/config/install/yamlform.yamlform.example_wizard.yml
+++ b/config/install/yamlform.yamlform.example_wizard.yml
@@ -7,7 +7,7 @@ description: 'An example of multiple step ''wizard'' form.'
 inputs: |
   information:
     '#title': 'Your Information'
-    '#type': yamlform_page
+    '#type': page
     '#open': true
     first_name:
       '#title': 'First Name'
@@ -21,7 +21,7 @@ inputs: |
       '#options': gender
   contact:
     '#title': 'Contact Information'
-    '#type': yamlform_page
+    '#type': page
     '#open': true
     email:
       '#title': Email
@@ -31,7 +31,7 @@ inputs: |
       '#type': tel
   feedback:
     '#title': 'Your Feedback'
-    '#type': yamlform_page
+    '#type': page
     '#open': true
     comments:
       '#type': textarea
diff --git a/src/Annotation/YamlFormElement.php b/src/Annotation/YamlFormElement.php
index 3e49a5e..e5c8b14 100644
--- a/src/Annotation/YamlFormElement.php
+++ b/src/Annotation/YamlFormElement.php
@@ -21,6 +21,7 @@ use Drupal\Component\Annotation\Plugin;
  * @see \Drupal\yamlform\YamlFormElementInterface
  * @see \Drupal\yamlform\YamlFormElementBase
  * @see \Drupal\yamlform\YamlFormElementManager
+ * @see \Drupal\yamlform\YamlFormElementManagerInterface
  * @see plugin_api
  *
  * @Annotation
diff --git a/src/Controller/YamlFormPluginBaseController.php b/src/Controller/YamlFormPluginBaseController.php
deleted file mode 100644
index 0ab4877..0000000
--- a/src/Controller/YamlFormPluginBaseController.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\yamlform\Controller\YamlFormPluginBaseController.
- */
-
-namespace Drupal\yamlform\Controller;
-
-use Drupal\Core\Controller\ControllerBase;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-use Drupal\Component\Plugin\PluginManagerInterface;
-
-/**
- * Controller for all YAML form handlers.
- */
-abstract class YamlFormPluginBaseController extends ControllerBase {
-
-  /**
-   * The name of the YAML form plugin.
-   *
-   * @var string
-   */
-  protected static $pluginName;
-
-  /**
-   * A YAML form plugin manager.
-   *
-   * @var \Drupal\Component\Plugin\PluginManagerInterface
-   */
-  protected $pluginManager;
-
-  /**
-   * Constructs a YamlFormPluginBaseController object.
-   *
-   * @param \Drupal\Component\Plugin\PluginManagerInterface $plugin_manager
-   *   A YAML form plugin manager.
-   */
-  public function __construct(PluginManagerInterface $plugin_manager) {
-    $this->pluginManager = $plugin_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static($container->get('plugin.manager.yamlform.' . static::$pluginName));
-  }
-
-  /**
-   * Displays a page with an overview of all available YAML form handler plugins.
-   */
-  abstract public function index();
-
-}
diff --git a/src/Controller/YamlFormPluginElementController.php b/src/Controller/YamlFormPluginElementController.php
index 7e045d0..a93dadd 100644
--- a/src/Controller/YamlFormPluginElementController.php
+++ b/src/Controller/YamlFormPluginElementController.php
@@ -7,54 +7,124 @@
 
 namespace Drupal\yamlform\Controller;
 
+use Drupal\Core\Controller\ControllerBase;
+use Drupal\Core\Render\ElementInfoManagerInterface;
+use Drupal\yamlform\YamlFormElementManagerInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
 /**
  * Controller for all YAML form elements.
  */
-class YamlFormPluginElementController extends YamlFormPluginBaseController {
+class YamlFormPluginElementController extends ControllerBase {
+
+  /**
+   * A element manager.
+   *
+   * @var \Drupal\Core\Render\ElementInfoManagerInterface
+   */
+  protected $elementManager;
+
+  /**
+   * A YAML form element plugin manager.
+   *
+   * @var \Drupal\yamlform\YamlFormElementManagerInterface
+   */
+  protected $yamlFormElementManager;
+
+  /**
+   * Constructs a YamlFormPluginBaseController object.
+   *
+   * @param \Drupal\Core\Render\ElementInfoManagerInterface $element_manager
+   *   A element plugin manager.
+   * @param \Drupal\yamlform\YamlFormElementManagerInterface $yamlform_element_manager
+   *   A YAML form element plugin manager.
+   */
+  public function __construct(ElementInfoManagerInterface $element_manager, YamlFormElementManagerInterface $yamlform_element_manager) {
+    $this->elementManager = $element_manager;
+    $this->yamlFormElementManager = $yamlform_element_manager;
+  }
 
   /**
    * {@inheritdoc}
    */
-  protected static $pluginName = 'element';
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('plugin.manager.element_info'),
+      $container->get('plugin.manager.yamlform.element')
+    );
+  }
 
   /**
    * {@inheritdoc}
    */
   public function index() {
-    $plugin_definitions = $this->pluginManager->getDefinitions();
-
-    $rows = [];
-    foreach ($plugin_definitions as $plugin_id => $plugin_definition) {
-      /** @var \Drupal\yamlform\YamlFormElementInterface $element */
-      $element = $this->pluginManager->createInstance($plugin_id);
-      $default_format = $element->getDefaultFormat();
-      $format_names = array_keys($element->getFormats());
-      $formats = array_combine($format_names, $format_names);
-      if (isset($formats[$default_format])) {
-        $formats[$default_format] = '<b>' . $formats[$default_format] . '</b>';
+
+    $yamlform_form_element_rows = [];
+    $element_rows = [];
+
+    $element_plugin_definitions = $this->elementManager->getDefinitions();
+    foreach ($element_plugin_definitions as $element_plugin_id => $element_plugin_definition) {
+      if ($this->yamlFormElementManager->hasDefinition($element_plugin_id)) {
+        /** @var \Drupal\yamlform\YamlFormElementInterface $yamlform_element */
+        $yamlform_element = $this->yamlFormElementManager->createInstance($element_plugin_id);
+        $yamlform_element_plugin_definition = $this->yamlFormElementManager->getDefinition($element_plugin_id);
+
+        $default_format = $yamlform_element->getDefaultFormat();
+        $format_names = array_keys($yamlform_element->getFormats());
+        $formats = array_combine($format_names, $format_names);
+        if (isset($formats[$default_format])) {
+          $formats[$default_format] = '<b>' . $formats[$default_format] . '</b>';
+        }
+
+        $yamlform_form_element_rows[$element_plugin_id]= [
+          $element_plugin_id,
+          $yamlform_element_plugin_definition['label'],
+          $yamlform_element_plugin_definition['multiline'] ? t('Yes') : t('No'),
+          ['data' => ['#markup' => implode('; ', $formats)]],
+          $element_plugin_definition['provider'],
+          $yamlform_element_plugin_definition['provider'],
+        ];
+      }
+      else {
+        $element_rows[$element_plugin_id] = [
+          $element_plugin_id,
+          $element_plugin_definition['provider'],
+        ];
       }
-      $rows[$plugin_id] = [
-        $plugin_definition['label'],
-        $plugin_id,
-        $plugin_definition['multiline'] ? t('Yes') : t('No'),
-        ['data' => ['#markup' => implode('; ', $formats)]],
-        $plugin_definition['provider'],
-      ];
     }
 
-    ksort($rows);
-    return [
+    $build = [];
+
+    ksort($yamlform_form_element_rows);
+    $build['yamlform_elements'] = [
       '#type' => 'table',
       '#header' => [
-        $this->t('Label'),
         $this->t('Name'),
+        $this->t('Label'),
         $this->t('Multiline'),
         $this->t('Formats'),
         $this->t('Provided by'),
+        $this->t('Integrated by'),
+      ],
+      '#rows' => $yamlform_form_element_rows,
+    ];
+
+    ksort($element_rows);
+    $build['elements'] = [
+      '#type' => 'details',
+      '#title' => $this->t('Additional elements'),
+      '#description' => t('Below are element that are available to a YAML form but do not have YAML form element plugin and/or require any additional integration'),
+      'table' => [
+        '#type' => 'table',
+        '#header' => [
+          $this->t('Name'),
+          $this->t('Provided by'),
+        ],
+        '#rows' => $element_rows,
       ],
-      '#rows' => $rows,
-      '#empty' => $this->t('There are no enabled %name plugins.', ['%name' => static::$pluginName]),
     ];
+
+    return $build;
   }
 
 }
diff --git a/src/Controller/YamlFormPluginHandlerController.php b/src/Controller/YamlFormPluginHandlerController.php
index 7d90fe1..aa6e93c 100644
--- a/src/Controller/YamlFormPluginHandlerController.php
+++ b/src/Controller/YamlFormPluginHandlerController.php
@@ -7,15 +7,40 @@
 
 namespace Drupal\yamlform\Controller;
 
+use Drupal\Core\Controller\ControllerBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\Component\Plugin\PluginManagerInterface;
+
 /**
  * Controller for all YAML form handlers.
  */
-class YamlFormPluginHandlerController extends YamlFormPluginBaseController {
+class YamlFormPluginHandlerController extends ControllerBase {
+
+  /**
+   * A YAML form handler plugin manager.
+   *
+   * @var \Drupal\Component\Plugin\PluginManagerInterface
+   */
+  protected $pluginManager;
+
+  /**
+   * Constructs a YamlFormPluginBaseController object.
+   *
+   * @param \Drupal\Component\Plugin\PluginManagerInterface $plugin_manager
+   *   A YAML form handler plugin manager.
+   */
+  public function __construct(PluginManagerInterface $plugin_manager) {
+    $this->pluginManager = $plugin_manager;
+  }
 
   /**
    * {@inheritdoc}
    */
-  public static $pluginName = 'handler';
+  public static function create(ContainerInterface $container) {
+    return new static(
+      $container->get('plugin.manager.yamlform.handler')
+    );
+  }
 
   /**
    * {@inheritdoc}
@@ -47,7 +72,6 @@ class YamlFormPluginHandlerController extends YamlFormPluginBaseController {
         $this->t('Provided by'),
       ],
       '#rows' => $rows,
-      '#empty' => $this->t('There are no enabled %name plugins.', ['%name' => static::$pluginName]),
     ];
   }
 
diff --git a/src/Controller/YamlFormSubmissionController.php b/src/Controller/YamlFormSubmissionController.php
index a73f03d..c752dc4 100644
--- a/src/Controller/YamlFormSubmissionController.php
+++ b/src/Controller/YamlFormSubmissionController.php
@@ -54,9 +54,6 @@ class YamlFormSubmissionController extends ControllerBase {
       '#type' => $type,
     ];
 
-    // Libraries.
-    $build['#attached']['library'][] = 'yamlform/codemirror.' . $type;
-
     return $build;
   }
 
diff --git a/src/Element/YamlFormCodeMirror.php b/src/Element/YamlFormCodeMirror.php
new file mode 100644
index 0000000..aa7e178
--- /dev/null
+++ b/src/Element/YamlFormCodeMirror.php
@@ -0,0 +1,163 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\yamlform\Element\YamlFormCodeMirror.
+ */
+
+namespace Drupal\yamlform\Element;
+
+use Drupal\Component\Serialization\Yaml;
+use Drupal\Core\Render\Element\Textarea;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Provides a form element for HTML, YAML, or Plain text using CodeMirror.
+ *
+ * @FormElement("yamlform_codemirror")
+ */
+class YamlFormCodeMirror extends Textarea {
+
+  /**
+   * An associative array of supported CodeMirror modes by type and mime-type.
+   *
+   * @var array
+   */
+  static protected $modes = [
+    'html' => 'text/html',
+    'text' => 'text/plain',
+    'yaml' => 'text/x-yaml',
+  ];
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getInfo() {
+    $class = get_class($this);
+    return [
+      '#input' => TRUE,
+      '#mode' => 'text',
+      '#cols' => 60,
+      '#rows' => 5,
+      '#resizable' => 'vertical',
+      '#process' => [
+        [$class, 'processYamlFormCodeMirror'],
+        [$class, 'processAjaxForm'],
+        [$class, 'processGroup'],
+      ],
+      '#pre_render' => [
+        [$class, 'preRenderYamlFormCodeMirror'],
+        [$class, 'preRenderGroup'],
+      ],
+      '#element_validate' => [
+        [$class, 'validateYamlFormCodeMirror'],
+      ],
+      '#theme' => 'textarea',
+      '#theme_wrappers' => ['form_element'],
+    ];
+  }
+
+  /**
+   * Processes a 'yamlform_codemirror' element.
+   */
+  public static function processYamlFormCodeMirror(&$element, FormStateInterface $form_state, &$complete_form) {
+    // Check that mode is defined and valid, if not default to (plain) text.
+    if (empty($element['#mode']) || !isset(self::$modes[$element['#mode']])) {
+      $element['#mode'] = 'text';
+    }
+    $element['#attached']['library'][] = 'yamlform/codemirror.' . $element['#mode'];
+    return $element;
+  }
+
+  /**
+   * Prepares a #type 'yamlform_code' render element for theme_input().
+   *
+   * @param array $element
+   *   An associative array containing the properties of the element.
+   *   Properties used: #title, #value, #description, #size, #maxlength,
+   *   #placeholder, #required, #attributes.
+   *
+   * @return array
+   *   The $element with prepared variables ready for theme_input().
+   */
+  public static function preRenderYamlFormCodeMirror($element) {
+    static::setAttributes($element, ['js-yamlform-codemirror', 'yamlform-codemirror', $element['#mode']]);
+    $element['#attributes']['data-yamlform-codemirror-mode'] = static::getMode($element['#mode']);
+    return $element;
+  }
+
+  /**
+   * Form element validation handler for #type 'yamlform_codemirror_yaml'.
+   */
+  public static function validateYamlFormCodeMirror(&$element, FormStateInterface $form_state, &$complete_form) {
+    if ($errors = static::getErrors($element, $form_state, $complete_form)) {
+      $build = [
+        'title' => [
+          '#markup' => t('%title is not valid.', ['%title' => $element['#title']]),
+        ],
+        'errors' => [
+          '#theme' => 'item_list',
+          '#items' => $errors,
+        ],
+      ];
+      $form_state->setError($element, \Drupal::service('renderer')->render($build));
+    }
+  }
+
+  /**
+   * Get validation errors.
+   */
+  protected static function getErrors(&$element, FormStateInterface $form_state, &$complete_form) {
+    switch ($element['#mode']) {
+      case 'html':
+        // @see: http://stackoverflow.com/questions/3167074/which-function-in-php-validate-if-the-string-is-valid-html
+        // @see: http://stackoverflow.com/questions/5030392/x-html-validator-in-php
+        libxml_use_internal_errors(TRUE);
+        if (simplexml_load_string('<fragment>' . $element['#value'] . '</fragment>')) {
+          return NULL;
+        }
+
+        $errors = libxml_get_errors();
+        libxml_clear_errors();
+        if (!$errors) {
+          return NULL;
+        }
+
+        $messages = [];
+        foreach ($errors as $error) {
+          $messages[] = $error->message;
+        }
+        return $messages;
+
+      case 'yaml';
+        try {
+          $value = trim($element['#value']);
+          $data = Yaml::decode($value);
+          if (!is_array($data) && $value) {
+            throw new \Exception(t('YAML must contain an associative array of inputs.'));
+          }
+          return NULL;
+        }
+        catch (\Exception $exception) {
+          return [$exception->getMessage()];
+        }
+
+      default:
+        return NULL;
+    }
+  }
+
+  /**
+   * Get the CodeMirror mode for specified type.
+   *
+   * @param string $mode
+   *   Mode (text, html, or yaml).
+   *
+   * @return string
+   *   The CodeMirror mode (aka mime type).
+   */
+  public static function getMode($mode) {
+    return (isset(static::$modes[$mode])) ? static::$modes[$mode] : static::$modes['text'];
+  }
+
+}
diff --git a/src/Element/YamlFormCodeMirrorBase.php b/src/Element/YamlFormCodeMirrorBase.php
deleted file mode 100644
index 404b889..0000000
--- a/src/Element/YamlFormCodeMirrorBase.php
+++ /dev/null
@@ -1,126 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\yamlform\Element\YamlFormCodeMirrorBase.
- */
-
-namespace Drupal\yamlform\Element;
-
-use Drupal\Core\Render\Element\Textarea;
-use Drupal\Core\Form\FormStateInterface;
-
-/**
- * Provides a base form element for YAML form CodeMirror elements.
- */
-abstract class YamlFormCodeMirrorBase extends Textarea {
-
-  /**
-   * Type of code.
-   *
-   * @var string
-   */
-  static protected $type;
-
-  /**
-   * An associative array of supported CodeMirror modes by type.
-   *
-   * @var array
-   */
-  static protected $modes = [
-    'html' => 'text/html',
-    'text' => 'text/plain',
-    'yaml' => 'text/x-yaml',
-  ];
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getInfo() {
-    $class = get_class($this);
-    return [
-      '#input' => TRUE,
-      '#cols' => 60,
-      '#rows' => 5,
-      '#resizable' => 'vertical',
-      '#process' => [
-        [$class, 'processYamlFormCodeMirror'],
-        [$class, 'processAjaxForm'],
-        [$class, 'processGroup'],
-      ],
-      '#pre_render' => [
-        [$class, 'preRenderYamlFormCodeMirror'],
-        [$class, 'preRenderGroup'],
-      ],
-      '#element_validate' => [
-        [$class, 'validateYamlFormCodeMirror'],
-      ],
-      '#theme' => 'textarea',
-      '#theme_wrappers' => ['form_element'],
-    ];
-  }
-
-  /**
-   * Processes a 'yamlform_codemirror_yaml' element.
-   */
-  public static function processYamlFormCodeMirror(&$element, FormStateInterface $form_state, &$complete_form) {
-    $element['#attached']['library'][] = 'yamlform/codemirror.' . static::$type;
-    return $element;
-  }
-
-  /**
-   * Form element validation handler for #type 'yamlform_codemirror_yaml'.
-   */
-  public static function validateYamlFormCodeMirror(&$element, FormStateInterface $form_state, &$complete_form) {
-    if ($errors = static::getErrors($element, $form_state, $complete_form)) {
-      $build = [
-        'title' => [
-          '#markup' => t('%title is not valid.', ['%title' => $element['#title']]),
-        ],
-        'errors' => [
-          '#theme' => 'item_list',
-          '#items' => $errors,
-        ],
-      ];
-      $form_state->setError($element, \Drupal::service('renderer')->render($build));
-    }
-  }
-
-  /**
-   * Prepares a #type 'yamlform_codemirror_yaml' render element for theme_input().
-   *
-   * @param array $element
-   *   An associative array containing the properties of the element.
-   *   Properties used: #title, #value, #description, #size, #maxlength,
-   *   #placeholder, #required, #attributes.
-   *
-   * @return array
-   *   The $element with prepared variables ready for theme_input().
-   */
-  public static function preRenderYamlFormCodeMirror($element) {
-    static::setAttributes($element, ['js-yamlform-codemirror', 'yamlform-codemirror', static::$type]);
-    $element['#attributes']['data-yamlform-codemirror-mode'] = static::getMode(static::$type);
-    return $element;
-  }
-
-  /**
-   * Get the CodeMirror mode for specified type.
-   *
-   * @param string $type
-   *   Type of code.
-   *
-   * @return string
-   *   The CodeMirror mode.
-   */
-  public static function getMode($type) {
-    return (isset(static::$modes[$type])) ? static::$modes[$type] : static::$modes['text'];
-  }
-
-  /**
-   * Get validation errors.
-   */
-  protected static function getErrors(&$element, FormStateInterface $form_state, &$complete_form) {
-    return NULL;
-  }
-
-}
diff --git a/src/Element/YamlFormCodeMirrorHtml.php b/src/Element/YamlFormCodeMirrorHtml.php
deleted file mode 100644
index d501b08..0000000
--- a/src/Element/YamlFormCodeMirrorHtml.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\yamlform\Element\YamlFormCodeMirrorHtml.
- */
-
-namespace Drupal\yamlform\Element;
-
-use Drupal\Core\Form\FormStateInterface;
-
-/**
- * Provides a form element for input of HTML using CodeMirror.
- *
- * @FormElement("yamlform_codemirror_html")
- */
-class YamlFormCodeMirrorHtml extends YamlFormCodeMirrorBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  static protected $type = 'html';
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function getErrors(&$element, FormStateInterface $form_state, &$complete_form) {
-    // @see: http://stackoverflow.com/questions/3167074/which-function-in-php-validate-if-the-string-is-valid-html
-    // @see: http://stackoverflow.com/questions/5030392/x-html-validator-in-php
-    libxml_use_internal_errors(TRUE);
-    if (simplexml_load_string('<fragment>' . $element['#value'] . '</fragment>')) {
-      return NULL;
-    }
-
-    $errors = libxml_get_errors();
-    libxml_clear_errors();
-    if (!$errors) {
-      return NULL;
-    }
-
-    $messages = [];
-    foreach ($errors as $error) {
-      $messages[] = $error->message;
-    }
-    return $messages;
-  }
-
-}
diff --git a/src/Element/YamlFormCodeMirrorText.php b/src/Element/YamlFormCodeMirrorText.php
deleted file mode 100644
index 8c30f7b..0000000
--- a/src/Element/YamlFormCodeMirrorText.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\yamlform\Element\YamlFormCodeMirrorText.
- */
-
-namespace Drupal\yamlform\Element;
-
-/**
- * Provides a form element for input of Plain text using CodeMirror.
- *
- * @FormElement("yamlform_codemirror_text")
- */
-class YamlFormCodeMirrorText extends YamlFormCodeMirrorBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  static protected $type = 'text';
-
-}
diff --git a/src/Element/YamlFormCodeMirrorYaml.php b/src/Element/YamlFormCodeMirrorYaml.php
deleted file mode 100644
index d1131d8..0000000
--- a/src/Element/YamlFormCodeMirrorYaml.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\yamlform\Element\YamlFormCodeMirrorYaml.
- */
-
-namespace Drupal\yamlform\Element;
-
-use Drupal\Component\Serialization\Yaml;
-use Drupal\Core\Form\FormStateInterface;
-
-/**
- * Provides a form element for input of YAML text using CodeMirror.
- *
- * @FormElement("yamlform_codemirror_yaml")
- */
-class YamlFormCodeMirrorYaml extends YamlFormCodeMirrorBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  static protected $type = 'yaml';
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function getErrors(&$element, FormStateInterface $form_state, &$complete_form) {
-    try {
-      $value = trim($element['#value']);
-      $data = Yaml::decode($value);
-      if (!is_array($data) && $value) {
-        throw new \Exception(t('YAML must contain an associative array of inputs.'));
-      }
-      return NULL;
-    }
-    catch (\Exception $exception) {
-      return [$exception->getMessage()];
-    }
-  }
-
-}
diff --git a/src/Entity/YamlForm.php b/src/Entity/YamlForm.php
index f8a5f24..d70f6a3 100644
--- a/src/Entity/YamlForm.php
+++ b/src/Entity/YamlForm.php
@@ -559,6 +559,9 @@ class YamlForm extends ConfigEntityBundleBase implements YamlFormInterface {
    *   The YAML form inputs.
    */
   protected function initInputsRecursive(array &$elements) {
+    /** @var \Drupal\Core\Render\ElementInfoManagerInterface $element_manager */
+    $element_manager = \Drupal::service('plugin.manager.element_info');
+
     // Remove ignored properties.
     $ignored_properties = self::getIgnoredProperties();
     $elements = array_diff_key($elements, array_flip($ignored_properties));
@@ -592,9 +595,17 @@ class YamlForm extends ConfigEntityBundleBase implements YamlFormInterface {
         $element['#access'] = $this->access('submission_view_any');
       }
 
-      // Track managed file upload.
-      if (isset($element['#type']) && $element['#type'] == 'managed_file') {
-        $this->hasManagedFile = TRUE;
+      if (isset($element['#type'])) {
+        // Track managed file upload.
+        if ($element['#type'] == 'managed_file') {
+          $this->hasManagedFile = TRUE;
+        }
+
+        // Set yamlform_* prefix to #type that are using alias without yamlform_
+        // namespace.
+        if (!$element_manager->hasDefinition($element['#type']) && $element_manager->hasDefinition('yamlform_' . $element['#type'])) {
+          $element['#type'] = 'yamlform_' . $element['#type'];
+        }
       }
 
       $this->flattenedInputs[$key] = $element;
@@ -608,7 +619,7 @@ class YamlForm extends ConfigEntityBundleBase implements YamlFormInterface {
    */
   public function getElements() {
     if (!isset($this->elements)) {
-      /** @var \Drupal\yamlform\YamlFormElementManager $yamlform_element_manager */
+      /** @var \Drupal\yamlform\YamlFormElementManagerInterface $yamlform_element_manager */
       $yamlform_element_manager = \Drupal::service('plugin.manager.yamlform.element');
       $this->elements = [];
       $inputs = $this->getFlattenedInputs();
diff --git a/src/Entity/YamlFormSubmission.php b/src/Entity/YamlFormSubmission.php
index eda25fb..f02b9c4 100644
--- a/src/Entity/YamlFormSubmission.php
+++ b/src/Entity/YamlFormSubmission.php
@@ -361,7 +361,7 @@ class YamlFormSubmission extends ContentEntityBase implements YamlFormSubmission
    * {@inheritdoc}
    */
   public function invokeYamlFormElement($method, array $element) {
-    /** @var \Drupal\yamlform\YamlFormElementManager $element_manager */
+    /** @var \Drupal\yamlform\YamlFormElementManagerInterface $element_manager */
     $element_manager = \Drupal::service('plugin.manager.yamlform.element');
     $element_manager->invokeMethod($method, $element, $this);
   }
diff --git a/src/Form/YamlFormAdminSettingsForm.php b/src/Form/YamlFormAdminSettingsForm.php
index 47e6d1e..256e0ae 100755
--- a/src/Form/YamlFormAdminSettingsForm.php
+++ b/src/Form/YamlFormAdminSettingsForm.php
@@ -16,7 +16,7 @@ use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
 use Drupal\file\Plugin\Field\FieldType\FileItem;
 use Drupal\yamlform\Entity\YamlForm;
-use Drupal\yamlform\YamlFormElementManager;
+use Drupal\yamlform\YamlFormElementManagerInterface;
 use Drupal\yamlform\YamlFormSubmissionExporter;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -35,7 +35,7 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
   /**
    * The YAML form element manager.
    *
-   * @var \Drupal\yamlform\YamlFormElementManager
+   * @var \Drupal\yamlform\YamlFormElementManagerInterface
    */
   protected $elementManager;
 
@@ -67,12 +67,12 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
    *   The factory for configuration objects.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $third_party_settings_manager
    *   The module handler.
-   * @param \Drupal\yamlform\YamlFormElementManager $element_manager
+   * @param \Drupal\yamlform\YamlFormElementManagerInterface $element_manager
    *   The YAML form element manager.
    * @param \Drupal\yamlform\YamlFormSubmissionExporter $submission_exporter
    *   The YAML form submission exporter.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $third_party_settings_manager, YamlFormElementManager $element_manager, YamlFormSubmissionExporter $submission_exporter) {
+  public function __construct(ConfigFactoryInterface $config_factory, ModuleHandlerInterface $third_party_settings_manager, YamlFormElementManagerInterface $element_manager, YamlFormSubmissionExporter $submission_exporter) {
     parent::__construct($config_factory);
     $this->moduleHandler = $third_party_settings_manager;
     $this->elementManager = $element_manager;
@@ -118,13 +118,15 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#tree' => TRUE,
     ];
     $form['form']['default_form_closed_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default closed message'),
       '#required' => TRUE,
       '#default_value' => $config->get('settings.default_form_closed_message'),
     ];
     $form['form']['default_form_exception_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default closed exception message'),
       '#required' => TRUE,
       '#default_value' => $config->get('settings.default_form_exception_message'),
@@ -137,7 +139,8 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#default_value' => $settings['default_form_submit_label'],
     ];
     $form['form']['default_form_confidential_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default confidential message'),
       '#required' => TRUE,
       '#default_value' => $config->get('settings.default_form_confidential_message'),
@@ -185,7 +188,8 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#default_value' => $settings['default_preview_prev_button_label'],
     ];
     $form['preview']['default_preview_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default preview message'),
       '#required' => TRUE,
       '#default_value' => $settings['default_preview_message'],
@@ -205,13 +209,15 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#default_value' => $settings['default_draft_button_label'],
     ];
     $form['draft']['default_draft_saved_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default draft save message'),
       '#required' => TRUE,
       '#default_value' => $settings['default_draft_saved_message'],
     ];
     $form['draft']['default_draft_loaded_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default draft load message'),
       '#required' => TRUE,
       '#default_value' => $settings['default_draft_loaded_message'],
@@ -224,7 +230,8 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#tree' => TRUE,
     ];
     $form['confirmation']['default_confirmation_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default confirmation message'),
       '#required' => TRUE,
       '#default_value' => $config->get('settings.default_confirmation_message'),
@@ -237,13 +244,15 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#tree' => TRUE,
     ];
     $form['limit']['default_limit_total_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default limit total message'),
       '#required' => TRUE,
       '#default_value' => $config->get('settings.default_limit_total_message'),
     ];
     $form['limit']['default_limit_user_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Default limit user message'),
       '#required' => TRUE,
       '#default_value' => $config->get('settings.default_limit_user_message'),
@@ -255,7 +264,8 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#tree' => TRUE,
     ];
     $form['inputs']['default_inputs']  = [
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#title' => $this->t('Default inputs'),
       '#description' => $this->t('These inputs will be displayed when a <a href=":href">new form</a> is created.', [':href' => Url::fromRoute('entity.yamlform.add_form')->toString()]),
       '#required' => TRUE,
@@ -415,13 +425,15 @@ class YamlFormAdminSettingsForm extends ConfigFormBase {
       '#tree' => TRUE,
     ];
     $form['test']['types'] = [
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#title' => $this->t('Test data by input type'),
       '#description' => $this->t("Above test data is keyed by FAPI element #type."),
       '#default_value' => $config->get('test.types'),
     ];
     $form['test']['names'] = [
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#title' => $this->t('Test data by input name'),
       '#description' => $this->t("Above test data is keyed by full or partial input names. For example, Using 'zip' will populate fields that are named 'zip' and 'zip_code' but not 'zipcode' or 'zipline'."),
       '#default_value' => $config->get('test.names'),
diff --git a/src/Form/YamlFormExportForm.php b/src/Form/YamlFormExportForm.php
index 0862e3d..1a292ce 100644
--- a/src/Form/YamlFormExportForm.php
+++ b/src/Form/YamlFormExportForm.php
@@ -23,7 +23,8 @@ class YamlFormExportForm extends EntityForm {
    */
   public function form(array $form, FormStateInterface $form_state) {
     $form['yaml'] = [
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#title' => $this->t("Here is your YAML form's configuration:"),
       '#description' => $this->t('Filename: %file', ['%file' => $this->getConfigName() . '.yml']),
       '#default_value' => $this->getYaml(),
diff --git a/src/Form/YamlFormHandlerAddForm.php b/src/Form/YamlFormHandlerAddForm.php
index dc4e049..6a33083 100644
--- a/src/Form/YamlFormHandlerAddForm.php
+++ b/src/Form/YamlFormHandlerAddForm.php
@@ -8,7 +8,7 @@
 namespace Drupal\yamlform\Form;
 
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\yamlform\YamlFormHandlerManager;
+use Drupal\yamlform\YamlFormHandlerManagerInterface;
 use Drupal\yamlform\YamlFormInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -20,17 +20,17 @@ class YamlFormHandlerAddForm extends YamlFormHandlerFormBase {
   /**
    * The YAML form handler manager.
    *
-   * @var \Drupal\yamlform\YamlFormHandlerManager
+   * @var \Drupal\yamlform\YamlFormHandlerManagerInterface
    */
   protected $yamlformHandlerManager;
 
   /**
    * Constructs a new YamlFormHandlerAddForm.
    *
-   * @param \Drupal\yamlform\YamlFormHandlerManager $yamlform_handler
+   * @param \Drupal\yamlform\YamlFormHandlerManagerInterface $yamlform_handler
    *   The YAML form handler manager.
    */
-  public function __construct(YamlFormHandlerManager $yamlform_handler) {
+  public function __construct(YamlFormHandlerManagerInterface $yamlform_handler) {
     $this->yamlformHandlerManager = $yamlform_handler;
   }
 
diff --git a/src/Plugin/Block/YamlFormBlock.php b/src/Plugin/Block/YamlFormBlock.php
index cf513a4..dcf6f89 100755
--- a/src/Plugin/Block/YamlFormBlock.php
+++ b/src/Plugin/Block/YamlFormBlock.php
@@ -47,7 +47,8 @@ class YamlFormBlock extends BlockBase {
     $form['default_data'] = [
       '#title' => $this->t('Default YAML form submission data (YAML)'),
       '#description' => $this->t('Enter YAML form submission data as name and value pairs which will be used to prepopulate the selected YAML form.'),
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#default_value' => $this->configuration['default_data'],
     ];
 
diff --git a/src/Plugin/Field/FieldWidget/YamlFormEntityReferenceAutocompleteWidget.php b/src/Plugin/Field/FieldWidget/YamlFormEntityReferenceAutocompleteWidget.php
index 5b9bc4e..d6731d0 100644
--- a/src/Plugin/Field/FieldWidget/YamlFormEntityReferenceAutocompleteWidget.php
+++ b/src/Plugin/Field/FieldWidget/YamlFormEntityReferenceAutocompleteWidget.php
@@ -36,7 +36,8 @@ class YamlFormEntityReferenceAutocompleteWidget extends EntityReferenceAutocompl
     $element = parent::formElement($items, $delta, $element, $form, $form_state);
 
     $element['default_data'] = [
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#title' => $this->t('Default YAML form submission data (YAML)'),
       '#description' => $this->t('Enter YAML form submission data as name and value pairs which will be used to prepopulate the selected YAML form.'),
       '#default_value' => $items[$delta]->default_data,
diff --git a/src/Plugin/YamlFormElement/Textarea.php b/src/Plugin/YamlFormElement/Textarea.php
index 23b8dd3..1abc839 100644
--- a/src/Plugin/YamlFormElement/Textarea.php
+++ b/src/Plugin/YamlFormElement/Textarea.php
@@ -9,6 +9,7 @@ namespace Drupal\yamlform\Plugin\YamlFormElement;
 
 use Drupal\yamlform\YamlFormElementBase;
 use Drupal\Component\Render\HtmlEscapedText;
+
 /**
  * Provides a 'textarea' element.
  *
diff --git a/src/Plugin/YamlFormElement/YamlFormCodeMirror.php b/src/Plugin/YamlFormElement/YamlFormCodeMirror.php
new file mode 100644
index 0000000..4d9be81
--- /dev/null
+++ b/src/Plugin/YamlFormElement/YamlFormCodeMirror.php
@@ -0,0 +1,78 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\yamlform\Plugin\YamlFormElement\YamlFormPage.
+ */
+
+namespace Drupal\yamlform\Plugin\YamlFormElement;
+
+use Drupal\yamlform\YamlFormElementBase;
+use Drupal\yamlform\YamlFormInterface;
+
+/**
+ * Provides a 'yamlform_codemirror' element.
+ *
+ * @YamlFormElement(
+ *   id = "yamlform_codemirror",
+ *   label = @Translation("CodeMirror"),
+ *   multiline = TRUE
+ * )
+ */
+class YamlFormCodeMirror extends YamlFormElementBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function formatHtml(array &$element, $value, array $options = []) {
+    if (empty($value)) {
+      return '';
+    }
+
+    $format = $this->getFormat($element);
+    switch ($format) {
+      case 'code':
+        return [
+          '#theme' => 'yamlform_codemirror',
+          '#code' => $value,
+          '#type' => $element['#mode'],
+        ];
+
+      default:
+        return parent::formatHtml($element, $value, $options);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getDefaultFormat() {
+    return 'code';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormats() {
+    return parent::getFormats() + [
+      'code' => $this->t('Code'),
+    ];
+  }
+
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getTestValue(array $element, YamlFormInterface $yamlform) {
+    switch ($element['#mode']) {
+      case 'html':
+        return '<p><b>Hello World!!!</b></p>';
+
+      case 'yaml':
+        return "message: 'Hello World'";
+
+      case 'text':
+        return "Hello World";
+    }
+  }
+}
diff --git a/src/Plugin/YamlFormElement/YamlFormPage.php b/src/Plugin/YamlFormElement/YamlFormPage.php
index 4f1a22f..a6d8c12 100644
--- a/src/Plugin/YamlFormElement/YamlFormPage.php
+++ b/src/Plugin/YamlFormElement/YamlFormPage.php
@@ -12,7 +12,7 @@ namespace Drupal\yamlform\Plugin\YamlFormElement;
  *
  * @YamlFormElement(
  *   id = "yamlform_page",
- *   label = @Translation("YamlFormPage")
+ *   label = @Translation("Page")
  * )
  */
 class YamlFormPage extends ContainerBase {
diff --git a/src/Plugin/YamlFormHandler/EmailYamlFormHandler.php b/src/Plugin/YamlFormHandler/EmailYamlFormHandler.php
index f1fee0f..d6ba078 100644
--- a/src/Plugin/YamlFormHandler/EmailYamlFormHandler.php
+++ b/src/Plugin/YamlFormHandler/EmailYamlFormHandler.php
@@ -161,7 +161,8 @@ class EmailYamlFormHandler extends YamlFormHandlerBase implements YamlFormHandle
         'default' => $yamlform_settings->get('mail.default_subject') ?: 'Form submission from: [yamlform-submission:source-entity]',
       ],
       'body' => [
-        'type' => 'yamlform_codemirror_text',
+        'type' => 'yamlform_codemirror',
+        'mode' => 'text',
         'label' => $this->t('Email body'),
         'default' => $this->getBodyDefaultValues($body_format),
       ],
@@ -205,6 +206,7 @@ class EmailYamlFormHandler extends YamlFormHandlerBase implements YamlFormHandle
 
     foreach ($settings as $config_name => $config_settings) {
       $type = $config_settings['type'];
+      $mode = isset($config_settings['mode']) ? $config_settings['mode'] : NULL;
       $label = $config_settings['label'];
       $group = preg_match('/^(to|from)/', $config_name, $match) ? $match[0] : 'message';
 
@@ -212,7 +214,7 @@ class EmailYamlFormHandler extends YamlFormHandlerBase implements YamlFormHandle
 
       // Set options.
       $options = [];
-      if ($type == 'textarea' || strpos($type, 'yamlform_codemirror_') === 0) {
+      if ($type == 'textarea' || $type == 'yamlform_codemirror') {
         $options['default'] = $this->t('Default:');
       }
       else {
@@ -251,6 +253,7 @@ class EmailYamlFormHandler extends YamlFormHandlerBase implements YamlFormHandle
       ];
       $form[$group][$config_name . '_custom'] = [
         '#type' => $type,
+        '#mode' => $mode,
         '#title' => $this->t('@label custom', ['@label' => $label]),
         '#title_display' => 'hidden',
         '#default_value' => $custom_value,
@@ -269,7 +272,7 @@ class EmailYamlFormHandler extends YamlFormHandlerBase implements YamlFormHandle
       // 'yamlform_codemirror_text' which throws
       // "An invalid form control with name='settings[message][body_custom]'
       // is not focusable." because the textarea is hidden by CodeMirror.
-      if ($type != 'yamlform_codemirror_text') {
+      if ($type != 'yamlform_codemirror') {
         $form[$group][$config_name . '_custom']['#states']['required'] = [
           ':input[name="settings[' . $group . '][' . $config_name . ']"]' => ['value' => 'custom'],
         ];
@@ -281,7 +284,8 @@ class EmailYamlFormHandler extends YamlFormHandlerBase implements YamlFormHandle
     $body_default_values = $this->getBodyDefaultValues();
     foreach ($body_default_values as $format => $default_value) {
       $form['message']['body_default_' . $format] = [
-        '#type' => 'yamlform_codemirror_' . $format,
+        '#type' => 'yamlform_codemirror',
+        '#mode' => $format,
         '#title' => $this->t('Body default value (@format)', ['@label' => $format]),
         '#title_display' => 'hidden',
         '#default_value' => $default_value,
@@ -538,7 +542,8 @@ class EmailYamlFormHandler extends YamlFormHandlerBase implements YamlFormHandle
     ];
     $body_format = ($this->configuration['html']) ? 'html' : 'text';
     $element['body'] = [
-      '#type' => 'yamlform_codemirror_' . $body_format,
+      '#type' => 'yamlform_codemirror',
+      '#mode' => $body_format,
       '#title' => $this->t('Message (@format)', ['@format' => ($this->configuration['html']) ? $this->t('HTML') : $this->t('Plain text')]),
       '#rows' => 10,
       '#required' => TRUE,
diff --git a/src/Tests/YamlFormCodeMirrorTest.php b/src/Tests/YamlFormCodeMirrorTest.php
deleted file mode 100755
index f30c00a..0000000
--- a/src/Tests/YamlFormCodeMirrorTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of Drupal\yamlform\test\YamlFormCodeMirrorTest.
- */
-
-namespace Drupal\yamlform\Tests;
-
-use Drupal\simpletest\WebTestBase;
-use Drupal\yamlform\Entity\YamlForm;
-
-/**
- * Tests for YAML form CodeMirror element.
- *
- * @group YamlForm
- */
-class YamlFormCodeMirrorTest extends WebTestBase {
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = ['system', 'block', 'node', 'user', 'yamlform', 'yamlform_test'];
-
-  /**
-   * Test CodeMirror element.
-   */
-  public function testCodeMirrorElement() {
-    // @see yamlform.yamlform.test_element_codemirror.yml.
-    /** @var \Drupal\yamlform\YamlFormInterface $yamlform */
-    $yamlform = YamlForm::load('test_element_codemirror');
-
-    /* YAML */
-
-    $this->drupalGet('yamlform/' . $yamlform->id());
-
-    // Check if CodeMirror library using local or CDN.
-    // This all depends on if CodeMirror is installed locally.
-    if (file_exists(DRUPAL_ROOT . '/libraries/codemirror')) {
-      $this->assertRaw('/libraries/codemirror/lib/codemirror.js');
-    }
-    else {
-      $this->assertRaw('https://cdnjs.cloudflare.com/ajax/libs/codemirror/');
-    }
-
-    // Check for YAML textarea with yamlform-codemirror class name.
-    $this->assertRaw('<textarea data-drupal-selector="edit-yaml" class="js-yamlform-codemirror yamlform-codemirror yaml form-textarea resize-vertical" data-yamlform-codemirror-mode="text/x-yaml" id="edit-yaml" name="yaml" rows="5" cols="60"></textarea>');
-
-    // Check submitting invalid YAML.
-    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['yaml' => "not\nvalid\nyaml"], t('Submit'));
-    $this->assertFieldByName('yaml', "not\nvalid\nyaml");
-    $this->assertRaw('<em class="placeholder">YAML</em>');
-    $this->assertRaw('<li>Unable to parse at line 1 (near &quot;not&quot;).</li>');
-
-    // Check submitting valid YAML.
-    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['yaml' => "valid: yaml"], t('Submit'));
-    $this->assertRaw('<a href="' . $yamlform->toUrl()->toString() . '">' . t('Back to form') . '</a>');
-    $this->assertNoRaw('<em class="placeholder">YAML</em> is not valid.');
-
-    /* HTML */
-    $this->drupalGet('yamlform/' . $yamlform->id());
-
-    // Check for HTML textarea with yamlform-codemirror class name.
-    $this->assertRaw('<textarea data-drupal-selector="edit-html" class="js-yamlform-codemirror yamlform-codemirror html form-textarea resize-vertical" data-yamlform-codemirror-mode="text/html" id="edit-html" name="html" rows="5" cols="60"></textarea>');
-
-    // Check submitting invalid HTML.
-    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['html' => "<b>not valid</em>"], t('Submit'));
-    $this->assertFieldByName('html', "<b>not valid</em>");
-    $this->assertRaw('<em class="placeholder">HTML</em> is not valid.');
-    $this->assertRaw('<li>Opening and ending tag mismatch: b line 1 and em');
-
-    // Check submitting valid HTML.
-    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['html' => "<b>valid</b>"], t('Submit'));
-    $this->assertRaw('<a href="' . $yamlform->toUrl()->toString() . '">' . t('Back to form') . '</a>');
-    $this->assertNoRaw('<em class="placeholder">HTML</em> is not valid.');
-  }
-
-}
diff --git a/src/Tests/YamlFormElementCodeMirrorTest.php b/src/Tests/YamlFormElementCodeMirrorTest.php
new file mode 100755
index 0000000..b3f6177
--- /dev/null
+++ b/src/Tests/YamlFormElementCodeMirrorTest.php
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\yamlform\test\YamlFormElementCodeMirrorTest.
+ */
+
+namespace Drupal\yamlform\Tests;
+
+use Drupal\simpletest\WebTestBase;
+use Drupal\yamlform\Entity\YamlForm;
+
+/**
+ * Tests for YAML form CodeMirror element.
+ *
+ * @group YamlForm
+ */
+class YamlFormElementCodeMirrorTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['system', 'block', 'node', 'user', 'yamlform', 'yamlform_test'];
+
+  /**
+   * Test CodeMirror element.
+   */
+  public function testCodeMirrorElement() {
+    // @see yamlform.yamlform.test_element_codemirror.yml.
+    /** @var \Drupal\yamlform\YamlFormInterface $yamlform */
+    $yamlform = YamlForm::load('test_element_codemirror');
+
+    /* YAML */
+
+    $this->drupalGet('yamlform/' . $yamlform->id());
+
+    // Check if CodeMirror library using local or CDN.
+    // This all depends on if CodeMirror is installed locally.
+    if (file_exists(DRUPAL_ROOT . '/libraries/codemirror')) {
+      $this->assertRaw('/libraries/codemirror/lib/codemirror.js');
+    }
+    else {
+      $this->assertRaw('https://cdnjs.cloudflare.com/ajax/libs/codemirror/');
+    }
+
+    // Check for YAML textarea with yamlform-codemirror class name.
+    $this->assertRaw('<textarea data-drupal-selector="edit-yaml" class="js-yamlform-codemirror yamlform-codemirror yaml form-textarea resize-vertical" data-yamlform-codemirror-mode="text/x-yaml" id="edit-yaml" name="yaml" rows="5" cols="60"></textarea>');
+
+    // Check submitting invalid YAML.
+    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['yaml' => "not\nvalid\nyaml"], t('Submit'));
+    $this->assertFieldByName('yaml', "not\nvalid\nyaml");
+    $this->assertRaw('<em class="placeholder">YAML</em>');
+    $this->assertRaw('<li>Unable to parse at line 1 (near &quot;not&quot;).</li>');
+
+    // Check submitting valid YAML.
+    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['yaml' => "valid: yaml"], t('Submit'));
+    $this->assertRaw('<a href="' . $yamlform->toUrl()->toString() . '">' . t('Back to form') . '</a>');
+    $this->assertNoRaw('<em class="placeholder">YAML</em> is not valid.');
+
+    /* HTML */
+    $this->drupalGet('yamlform/' . $yamlform->id());
+
+    // Check for HTML textarea with yamlform-codemirror class name.
+    $this->assertRaw('<textarea data-drupal-selector="edit-html" class="js-yamlform-codemirror yamlform-codemirror html form-textarea resize-vertical" data-yamlform-codemirror-mode="text/html" id="edit-html" name="html" rows="5" cols="60"></textarea>');
+
+    // Check submitting invalid HTML.
+    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['html' => "<b>not valid</em>"], t('Submit'));
+    $this->assertFieldByName('html', "<b>not valid</em>");
+    $this->assertRaw('<em class="placeholder">HTML</em> is not valid.');
+    $this->assertRaw('<li>Opening and ending tag mismatch: b line 1 and em');
+
+    // Check submitting valid HTML.
+    $this->drupalPostForm('yamlform/' . $yamlform->id(), ['html' => "<b>valid</b>"], t('Submit'));
+    $this->assertRaw('<a href="' . $yamlform->toUrl()->toString() . '">' . t('Back to form') . '</a>');
+    $this->assertNoRaw('<em class="placeholder">HTML</em> is not valid.');
+  }
+
+}
diff --git a/src/YamlFormElementBase.php b/src/YamlFormElementBase.php
index a86f7e7..8f9664a 100644
--- a/src/YamlFormElementBase.php
+++ b/src/YamlFormElementBase.php
@@ -17,6 +17,7 @@ use Drupal\Core\StringTranslation\StringTranslationTrait;
  *
  * @see \Drupal\yamlform\YamlFormElementInterface
  * @see \Drupal\yamlform\YamlFormElementManager
+ * @see \Drupal\yamlform\YamlFormElementManagerInterface
  * @see plugin_api
  */
 class YamlFormElementBase extends PluginBase implements YamlFormElementInterface {
@@ -153,6 +154,11 @@ class YamlFormElementBase extends PluginBase implements YamlFormElementInterface
       return '';
     }
 
+    // Flatten arrays. Generally, $value is a string.
+    if (is_array($value)) {
+      $value = implode(', ', $value);
+    }
+
     // Apply XSS filter to value that contains HTML tags and is not formatted as
     // raw.
     $format = $this->getFormat($element);
diff --git a/src/YamlFormElementInterface.php b/src/YamlFormElementInterface.php
index 17dddc6..d227be0 100644
--- a/src/YamlFormElementInterface.php
+++ b/src/YamlFormElementInterface.php
@@ -16,6 +16,7 @@ use Drupal\Core\Form\FormStateInterface;
  * @see \Drupal\yamlform\Annotation\YamlFormElement
  * @see \Drupal\yamlform\YamlFormElementBase
  * @see \Drupal\yamlform\YamlFormElementManager
+ * @see \Drupal\yamlform\YamlFormElementManagerInterface
  * @see plugin_api
  */
 interface YamlFormElementInterface extends PluginInspectionInterface {
diff --git a/src/YamlFormElementManager.php b/src/YamlFormElementManager.php
index 0296093..b09fda8 100644
--- a/src/YamlFormElementManager.php
+++ b/src/YamlFormElementManager.php
@@ -14,7 +14,7 @@ use Drupal\Core\Plugin\DefaultPluginManager;
 use Drupal\yamlform\Plugin\YamlFormElement\ContainerBase;
 
 /**
- * Manages YAML form element plugins.
+ * Provides a plugin manager for YAML form element plugins.
  *
  * @see hook_yamlform_element_info_alter()
  * @see \Drupal\yamlform\Annotation\YamlFormElement
@@ -22,7 +22,7 @@ use Drupal\yamlform\Plugin\YamlFormElement\ContainerBase;
  * @see \Drupal\yamlform\YamlFormElementBase
  * @see plugin_api
  */
-class YamlFormElementManager extends DefaultPluginManager implements FallbackPluginManagerInterface {
+class YamlFormElementManager extends DefaultPluginManager implements FallbackPluginManagerInterface, YamlFormElementManagerInterface {
 
   /**
    * List of already instantiated YAML form element plugins.
@@ -69,10 +69,7 @@ class YamlFormElementManager extends DefaultPluginManager implements FallbackPlu
   }
 
   /**
-   * Get all available YAML form element plugin instances.
-   *
-   * @return \Drupal\yamlform\YamlFormElementInterface[]
-   *   An array of all available YAML form element plugin instances.
+   * {@inheritdoc}
    */
   public function getInstances() {
     $plugin_definitions = $this->getDefinitions();
@@ -91,22 +88,7 @@ class YamlFormElementManager extends DefaultPluginManager implements FallbackPlu
   }
 
   /**
-   * Invoke a method for specific FAPI element.
-   *
-   * @param string $method
-   *   The method name.
-   * @param array $element
-   *   An associative array containing an element with a #type property.
-   * @param mixed $context1
-   *   (optional) An additional variable that is passed by reference.
-   * @param mixed $context2
-   *   (optional) An additional variable that is passed by reference. If more
-   *   context needs to be provided to implementations, then this should be an
-   *   associative array as described above.
-   *
-   * @return mixed|null
-   *   Return result of the invoked method.  NULL will be returned if the
-   *   element and/or method name does not exist.
+   * {@inheritdoc}
    */
   public function invokeMethod($method, array &$element, &$context1 = NULL, &$context2 = NULL) {
     // Make sure element has #type.
@@ -124,13 +106,7 @@ class YamlFormElementManager extends DefaultPluginManager implements FallbackPlu
   }
 
   /**
-   * Is an element a container.
-   *
-   * @param array $element
-   *   A element.
-   *
-   * @return bool
-   *   TRUE if the element is a container.
+   * {@inheritdoc}
    */
   public function isContainer(array $element) {
     if (!$element['#type']) {
diff --git a/src/YamlFormElementManagerInterface.php b/src/YamlFormElementManagerInterface.php
new file mode 100644
index 0000000..b817152
--- /dev/null
+++ b/src/YamlFormElementManagerInterface.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\yamlform\YamlFormElementManagerInterface.
+ */
+
+namespace Drupal\yamlform;
+
+use Drupal\Component\Plugin\FallbackPluginManagerInterface;
+use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface;
+use Drupal\Component\Plugin\PluginManagerInterface;
+
+/**
+ * Collects available YAML form elements.
+ */
+interface YamlFormElementManagerInterface extends PluginManagerInterface, CachedDiscoveryInterface, FallbackPluginManagerInterface {
+
+  /**
+   * Get all available YAML form element plugin instances.
+   *
+   * @return \Drupal\yamlform\YamlFormElementInterface[]
+   *   An array of all available YAML form element plugin instances.
+   */
+  public function getInstances();
+
+  /**
+   * Invoke a method for specific FAPI element.
+   *
+   * @param string $method
+   *   The method name.
+   * @param array $element
+   *   An associative array containing an element with a #type property.
+   * @param mixed $context1
+   *   (optional) An additional variable that is passed by reference.
+   * @param mixed $context2
+   *   (optional) An additional variable that is passed by reference. If more
+   *   context needs to be provided to implementations, then this should be an
+   *   associative array as described above.
+   *
+   * @return mixed|null
+   *   Return result of the invoked method.  NULL will be returned if the
+   *   element and/or method name does not exist.
+   */
+  public function invokeMethod($method, array &$element, &$context1 = NULL, &$context2 = NULL);
+
+  /**
+   * Is an element a container.
+   *
+   * @param array $element
+   *   A element.
+   *
+   * @return bool
+   *   TRUE if the element is a container.
+   */
+  public function isContainer(array $element);
+
+}
diff --git a/src/YamlFormEntityForm.php b/src/YamlFormEntityForm.php
index a85f49a..2a012f5 100644
--- a/src/YamlFormEntityForm.php
+++ b/src/YamlFormEntityForm.php
@@ -57,7 +57,8 @@ class YamlFormEntityForm extends BundleEntityFormBase {
       '#required' => TRUE,
     ];
     $form['description'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Administrative description'),
       '#default_value' => $yamlform->get('description'),
       '#rows' => 2,
@@ -73,7 +74,8 @@ class YamlFormEntityForm extends BundleEntityFormBase {
       ':yaml_href' => 'https://en.wikipedia.org/wiki/YAML',
     ];
     $form['inputs'] = [
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#title' => $this->t('Inputs (YAML)'),
       '#description' => $this->t('Enter a <a href=":form_api_href">Form API (FAPI)</a> and/or a <a href=":render_api_href">Render Array</a> as <a href=":yaml_href">YAML</a>.', $t_args),
       '#default_value' => $default_value ,
diff --git a/src/YamlFormEntityHandlersForm.php b/src/YamlFormEntityHandlersForm.php
index 6a43e58..ffcac2d 100644
--- a/src/YamlFormEntityHandlersForm.php
+++ b/src/YamlFormEntityHandlersForm.php
@@ -27,17 +27,17 @@ class YamlFormEntityHandlersForm extends EntityForm {
   /**
    * The YAML form handler manager service.
    *
-   * @var \Drupal\yamlform\YamlFormHandlerManager
+   * @var \Drupal\yamlform\YamlFormHandlerManagerInterface
    */
   protected $yamlFormHandlerManager;
 
   /**
    * Constructs an YamlFormEntityHandlersForm object.
    *
-   * @param \Drupal\yamlform\YamlFormHandlerManager $yamlform_handler_manager
+   * @param \Drupal\yamlform\YamlFormHandlerManagerInterface $yamlform_handler_manager
    *   The YAML form handler manager service.
    */
-  public function __construct(YamlFormHandlerManager $yamlform_handler_manager) {
+  public function __construct(YamlFormHandlerManagerInterface $yamlform_handler_manager) {
     $this->yamlFormHandlerManager = $yamlform_handler_manager;
   }
 
diff --git a/src/YamlFormEntitySettingsForm.php b/src/YamlFormEntitySettingsForm.php
index 0c53cf5..88b2c3c 100644
--- a/src/YamlFormEntitySettingsForm.php
+++ b/src/YamlFormEntitySettingsForm.php
@@ -88,13 +88,15 @@ class YamlFormEntitySettingsForm extends EntityForm {
       '#parents' => ['status'],
     ];
     $form['form']['form_closed_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Form closed message'),
       '#description' => $this->t('A message to be displayed notifying the user that the form is closed.'),
       '#default_value' => $settings['form_closed_message'],
     ];
     $form['form']['form_exception_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Form exception message'),
       '#description' => $this->t('A message to be displayed if the form breaks.'),
       '#default_value' => $settings['form_closed_message'],
@@ -112,7 +114,8 @@ class YamlFormEntitySettingsForm extends EntityForm {
       '#default_value' => $settings['form_prepopulate'],
     ];
     $form['form']['form_confidential_message']  = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Form confidential message'),
       '#description' => $this->t('A message to be displayed when authenticated users try to access a confidential form.'),
       '#default_value' => $settings['form_confidential_message'],
@@ -192,7 +195,8 @@ class YamlFormEntitySettingsForm extends EntityForm {
       '#default_value' => $settings['preview_prev_button_label'],
     ];
     $form['preview']['settings']['preview_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Preview message'),
       '#description' => $this->t('A message to be displayed on the preview page.'),
       '#default_value' => $settings['preview_message'],
@@ -231,13 +235,15 @@ class YamlFormEntitySettingsForm extends EntityForm {
       '#default_value' => $settings['draft_button_label'],
     ];
     $form['draft']['settings']['draft_saved_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Draft saved message'),
       '#description' => $this->t('Message to be displayed when a draft is saved.'),
       '#default_value' => $settings['draft_saved_message'],
     ];
     $form['draft']['settings']['draft_loaded_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Draft loaded message'),
       '#description' => $this->t('Message to be displayed when a draft is loaded.'),
       '#default_value' => $settings['draft_loaded_message'],
@@ -261,7 +267,8 @@ class YamlFormEntitySettingsForm extends EntityForm {
     ];
 
     $form['confirmation']['confirmation_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Confirmation message'),
       '#description' => $this->t('Message to be shown upon successful submission. If the confirmation type is set to <em>Page</em> it will be shown on its own page, otherwise this displays as a message.'),
       '#default_value' => $settings['confirmation_message'],
@@ -290,7 +297,8 @@ class YamlFormEntitySettingsForm extends EntityForm {
       '#default_value' => $settings['limit_total'],
     ];
     $form['submission']['limit_total_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Limit total message'),
       '#default_value' => $settings['limit_total_message'],
     ];
@@ -300,7 +308,8 @@ class YamlFormEntitySettingsForm extends EntityForm {
       '#default_value' => $settings['limit_user'],
     ];
     $form['submission']['limit_user_message'] = [
-      '#type' => 'yamlform_codemirror_html',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'html',
       '#title' => $this->t('Limit user message'),
       '#default_value' => $settings['limit_user_message'],
     ];
diff --git a/src/YamlFormEntityThirdPartySettingsForm.php b/src/YamlFormEntityThirdPartySettingsForm.php
index 753fa67..8dd7670 100644
--- a/src/YamlFormEntityThirdPartySettingsForm.php
+++ b/src/YamlFormEntityThirdPartySettingsForm.php
@@ -19,7 +19,7 @@ class YamlFormEntityThirdPartySettingsForm extends EntityForm {
    * {@inheritdoc}
    */
   public function form(array $form, FormStateInterface $form_state) {
-    /** @var \Drupal\yamlform\YamlFormHandlerManager $third_party_settings_manager */
+    /** @var \Drupal\yamlform\YamlFormThirdPartySettingsManagerInterface $third_party_settings_manager */
     $third_party_settings_manager = \Drupal::service('yamlform.third_party_settings_manager');
     $form = $third_party_settings_manager->buildForm($form, $form_state);
     $form_state->set('yamlform', $this->getEntity());
diff --git a/src/YamlFormHandlerBase.php b/src/YamlFormHandlerBase.php
index b3ad810..2b6a3a9 100644
--- a/src/YamlFormHandlerBase.php
+++ b/src/YamlFormHandlerBase.php
@@ -17,6 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  *
  * @see \Drupal\yamlform\YamlFormHandlerInterface
  * @see \Drupal\yamlform\YamlFormHandlerManager
+ * @see \Drupal\yamlform\YamlFormHandlerManagerInterface
  * @see plugin_api
  */
 abstract class YamlFormHandlerBase extends PluginBase implements YamlFormHandlerInterface {
diff --git a/src/YamlFormHandlerInterface.php b/src/YamlFormHandlerInterface.php
index 0cbedb2..802dd08 100644
--- a/src/YamlFormHandlerInterface.php
+++ b/src/YamlFormHandlerInterface.php
@@ -19,6 +19,7 @@ use Drupal\Core\Plugin\PluginFormInterface;
  * @see \Drupal\yamlform\Annotation\YamlFormHandler
  * @see \Drupal\yamlform\YamlFormHandlerBase
  * @see \Drupal\yamlform\YamlFormHandlerManager
+ * @see \Drupal\yamlform\YamlFormHandlerManagerInterface
  * @see plugin_api
  */
 interface YamlFormHandlerInterface extends PluginInspectionInterface, ConfigurablePluginInterface, ContainerFactoryPluginInterface, PluginFormInterface {
diff --git a/src/YamlFormHandlerManager.php b/src/YamlFormHandlerManager.php
index 777082f..2750b67 100644
--- a/src/YamlFormHandlerManager.php
+++ b/src/YamlFormHandlerManager.php
@@ -20,7 +20,7 @@ use Drupal\Core\Plugin\DefaultPluginManager;
  * @see \Drupal\yamlform\YamlFormHandlerBase
  * @see plugin_api
  */
-class YamlFormHandlerManager extends DefaultPluginManager {
+class YamlFormHandlerManager extends DefaultPluginManager implements YamlFormHandlerManagerInterface {
 
   /**
    * Constructs a new YamlFormHandlerManager.
diff --git a/src/YamlFormHandlerManagerInterface.php b/src/YamlFormHandlerManagerInterface.php
new file mode 100644
index 0000000..9ae327b
--- /dev/null
+++ b/src/YamlFormHandlerManagerInterface.php
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\yamlform\YamlFormHandlerManagerInterface.
+ */
+
+namespace Drupal\yamlform;
+
+use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface;
+use Drupal\Component\Plugin\PluginManagerInterface;
+
+/**
+ * Collects available YAML form handlers.
+ */
+interface YamlFormHandlerManagerInterface extends PluginManagerInterface, CachedDiscoveryInterface {
+
+}
diff --git a/src/YamlFormOptionsForm.php b/src/YamlFormOptionsForm.php
index fde757f..00a8044 100644
--- a/src/YamlFormOptionsForm.php
+++ b/src/YamlFormOptionsForm.php
@@ -42,7 +42,8 @@ class YamlFormOptionsForm extends EntityForm {
     ];
 
     $form['options'] = [
-      '#type' => 'yamlform_codemirror_yaml',
+      '#type' => 'yamlform_codemirror',
+      '#mode' => 'yaml',
       '#title' => $this->t('Options (YAML)'),
       '#description' => $this->t('Key-value pairs MUST be specified as "safe_key: \'Some readable option\'". Use of only alphanumeric characters and underscores is recommended in keys. One option per line. Option groups can be created by using just the group name followed by indented group options.'),
       '#required' => TRUE,
diff --git a/src/YamlFormSubmissionExporter.php b/src/YamlFormSubmissionExporter.php
index 16333c5..daa16b3 100644
--- a/src/YamlFormSubmissionExporter.php
+++ b/src/YamlFormSubmissionExporter.php
@@ -46,7 +46,7 @@ class YamlFormSubmissionExporter {
   /**
    * YAML form element manager.
    *
-   * @var \Drupal\yamlform\YamlFormElementManager
+   * @var \Drupal\yamlform\YamlFormElementManagerInterface
    */
   protected $yamlformElementManager;
 
@@ -67,10 +67,10 @@ class YamlFormSubmissionExporter {
    *   The entity manager.
    * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
    *   The entity query factory.
-   * @param \Drupal\yamlform\YamlFormElementManager $yamlform_element_manager
+   * @param \Drupal\yamlform\YamlFormElementManagerInterface $yamlform_element_manager
    *   The YAML form element manager.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, QueryFactory $query_factory, YamlFormElementManager $yamlform_element_manager) {
+  public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, QueryFactory $query_factory, YamlFormElementManagerInterface $yamlform_element_manager) {
     $this->configFactory = $config_factory;
     $this->entityStorage = $entity_manager->getStorage('yamlform_submission')->getFieldDefinitions();
     $this->queryFactory = $query_factory;
diff --git a/src/YamlFormSubmissionForm.php b/src/YamlFormSubmissionForm.php
index 78ab211..721d1cc 100755
--- a/src/YamlFormSubmissionForm.php
+++ b/src/YamlFormSubmissionForm.php
@@ -26,7 +26,7 @@ class YamlFormSubmissionForm extends ContentEntityForm {
   /**
    * The YAML form element (plugin) manager.
    *
-   * @var \Drupal\yamlform\YamlFormElementManager
+   * @var \Drupal\yamlform\YamlFormElementManagerInterface
    */
   protected $elementManager;
 
@@ -70,12 +70,12 @@ class YamlFormSubmissionForm extends ContentEntityForm {
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager.
-   * @param \Drupal\yamlform\YamlFormElementManager $element_manager
+   * @param \Drupal\yamlform\YamlFormElementManagerInterface $element_manager
    *   The YAML form element manager.
    * @param \Drupal\yamlform\YamlFormThirdPartySettingsManagerInterface $third_party_settings_manager
    *   The YAML form third party settings manager.
    */
-  public function __construct(EntityManagerInterface $entity_manager, YamlFormElementManager $element_manager, YamlFormThirdPartySettingsManagerInterface $third_party_settings_manager, YamlFormMessageManagerInterface $message_manager) {
+  public function __construct(EntityManagerInterface $entity_manager, YamlFormElementManagerInterface $element_manager, YamlFormThirdPartySettingsManagerInterface $third_party_settings_manager, YamlFormMessageManagerInterface $message_manager) {
     parent::__construct($entity_manager);
     $this->elementManager = $element_manager;
     $this->storage = $this->entityManager->getStorage('yamlform_submission');
diff --git a/src/YamlFormSubmissionGenerate.php b/src/YamlFormSubmissionGenerate.php
index 855a0f7..23b20d2 100644
--- a/src/YamlFormSubmissionGenerate.php
+++ b/src/YamlFormSubmissionGenerate.php
@@ -33,7 +33,7 @@ class YamlFormSubmissionGenerate {
   /**
    * The YAML form element manager.
    *
-   * @var \Drupal\yamlform\YamlFormElementManager
+   * @var \Drupal\yamlform\YamlFormElementManagerInterface
    */
   protected $elementManager;
 
@@ -44,10 +44,10 @@ class YamlFormSubmissionGenerate {
    *   The configuration object factory.
    * @param \Drupal\Core\Utility\Token $token
    *   The token service.
-   * @param \Drupal\yamlform\YamlFormElementManager $element_manager
+   * @param \Drupal\yamlform\YamlFormElementManagerInterface $element_manager
    *   The YAML form element manager.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, Token $token, YamlFormElementManager $element_manager) {
+  public function __construct(ConfigFactoryInterface $config_factory, Token $token, YamlFormElementManagerInterface $element_manager) {
     $this->configFactory = $config_factory;
     $this->token = $token;
     $this->elementManager = $element_manager;
@@ -166,7 +166,6 @@ class YamlFormSubmissionGenerate {
       }
     }
 
-    // Get test value using #type.
     switch ($element['#type']) {
       case 'range';
       case 'number';
@@ -174,11 +173,6 @@ class YamlFormSubmissionGenerate {
         return rand($element['#min'], $element['#max']);
     }
 
-    // Get test #unique value.
-    if (!empty($element['#unique'])) {
-      return uniqid();
-    }
-
     // Return default values.
     return (isset($this->names['default'])) ? $this->names['default'] : NULL;
   }
diff --git a/src/YamlFormSubmissionListBuilder.php b/src/YamlFormSubmissionListBuilder.php
index ac6ef09..0972ad0 100755
--- a/src/YamlFormSubmissionListBuilder.php
+++ b/src/YamlFormSubmissionListBuilder.php
@@ -58,7 +58,7 @@ class YamlFormSubmissionListBuilder extends EntityListBuilder {
   /**
    * The YAMl form element manager.
    *
-   * @var \Drupal\yamlform\YamlFormElementManager
+   * @var \Drupal\yamlform\YamlFormElementManagerInterface
    */
   protected $elementManager;
 
diff --git a/src/YamlFormSubmissionViewBuilder.php b/src/YamlFormSubmissionViewBuilder.php
index f0a3d76..82998da 100644
--- a/src/YamlFormSubmissionViewBuilder.php
+++ b/src/YamlFormSubmissionViewBuilder.php
@@ -40,14 +40,14 @@ class YamlFormSubmissionViewBuilder extends EntityViewBuilder {
   /**
    * The YAML form handler manager service.
    *
-   * @var \Drupal\yamlform\YamlFormHandlerManager
+   * @var \Drupal\yamlform\YamlFormHandlerManagerInterface
    */
   protected $yamlFormHandlerManager;
 
   /**
    * The YAML form element manager service.
    *
-   * @var \Drupal\yamlform\YamlFormElementManager
+   * @var \Drupal\yamlform\YamlFormElementManagerInterface
    */
   protected $yamlFormElementManager;
 
@@ -64,12 +64,12 @@ class YamlFormSubmissionViewBuilder extends EntityViewBuilder {
    *   The config factory.
    * @param \Drupal\Core\Utility\Token $token
    *   The token handler.
-   * @param \Drupal\yamlform\YamlFormHandlerManager $yamlform_handler_manager
+   * @param \Drupal\yamlform\YamlFormHandlerManagerInterface $yamlform_handler_manager
    *   The YAML form handler manager service.
-   * @param \Drupal\yamlform\YamlFormElementManager $yamlform_element_manager
+   * @param \Drupal\yamlform\YamlFormElementManagerInterfaceInterface $yamlform_element_manager
    *   The YAML form element manager service.
    */
-  public function __construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, Token $token, YamlFormHandlerManager $yamlform_handler_manager, YamlFormElementManager $yamlform_element_manager) {
+  public function __construct(EntityTypeInterface $entity_type, EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, Token $token, YamlFormHandlerManagerInterface $yamlform_handler_manager, YamlFormElementManagerInterface $yamlform_element_manager) {
     parent::__construct($entity_type, $entity_manager, $language_manager);
     $this->configFactory = $config_factory;
     $this->token = $token;
diff --git a/src/YamlFormThirdPartySettingsManager.php b/src/YamlFormThirdPartySettingsManager.php
index 2c9e5bc..3543ab3 100644
--- a/src/YamlFormThirdPartySettingsManager.php
+++ b/src/YamlFormThirdPartySettingsManager.php
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Contains \Drupal\yamlform\YamlFormHandlerManager.
+ * Contains \Drupal\yamlform\YamlFormThirdPartySettingsManager.
  */
 
 namespace Drupal\yamlform;
diff --git a/templates/yamlform-codemirror.html.twig b/templates/yamlform-codemirror.html.twig
index 6e97f04..6291f9f 100644
--- a/templates/yamlform-codemirror.html.twig
+++ b/templates/yamlform-codemirror.html.twig
@@ -1,7 +1,7 @@
 {#
 /**
  * @file
- * Theme implementation for a'CodeMirror' code.
+ * Theme implementation for 'CodeMirror' code.
  *
  * Available variables
  * - code: The code.
@@ -9,10 +9,17 @@
  * - mode: The CodeMirror mode used to format the code.
  *
  * @see http://codemirror.net/doc/manual.html#option_mode
- * @see \Drupal\yamlform\Element\YamlFormCodeMirrorBase()
+ * @see \Drupal\yamlform\Element\YamlFormCodeMirror()
  * @see template_preprocess_yamlform_codemirror()
  *
  * @ingroup themeable
  */
 #}
+{% if type == 'html' %}
+  {{ attach_library('yamlform/codemirror.html') }}
+{% elseif type == 'yaml' %}
+  {{ attach_library('yamlform/codemirror.yaml') }}
+{% else %}
+  {{ attach_library('yamlform/codemirror.text') }}
+{% endif %}
 <pre class="js-yamlform-codemirror-runmode yamlform-codemirror-runmode" data-yamlform-codemirror-mode="{{ mode }}">{{ code }}</pre>
diff --git a/tests/modules/yamlform_test/config/install/yamlform.yamlform.test_element_codemirror.yml b/tests/modules/yamlform_test/config/install/yamlform.yamlform.test_element_codemirror.yml
index c49a582..4fd9c01 100644
--- a/tests/modules/yamlform_test/config/install/yamlform.yamlform.test_element_codemirror.yml
+++ b/tests/modules/yamlform_test/config/install/yamlform.yamlform.test_element_codemirror.yml
@@ -6,13 +6,16 @@ title: 'Test: Element: CodeMirror'
 description: 'Test the YAML form modules''s CodeMirror element used for entering and validating YAML.'
 inputs: |
   yaml:
-    '#type': yamlform_codemirror_yaml
+    '#type': yamlform_codemirror
+    '#mode': yaml
     '#title': 'YAML'
   html:
-    '#type': yamlform_codemirror_html
+    '#type': yamlform_codemirror
+    '#mode': html
     '#title': 'HTML'
   text:
-    '#type': yamlform_codemirror_text
+    '#type': yamlform_codemirror
+    '#mode': text
     '#title': 'Plain text'
 settings:
   page: true
diff --git a/tests/modules/yamlform_test/yamlform_test.features.yml b/tests/modules/yamlform_test/yamlform_test.features.yml
index f32a580..31ffb9f 100644
--- a/tests/modules/yamlform_test/yamlform_test.features.yml
+++ b/tests/modules/yamlform_test/yamlform_test.features.yml
@@ -1 +1,33 @@
-true
\ No newline at end of file
+required:
+  - yamlform.yamlform.test_confirmation_inline.yml
+  - yamlform.yamlform.test_confirmation_message.yml
+  - yamlform.yamlform.test_confirmation_page.yml
+  - yamlform.yamlform.test_confirmation_url.yml
+  - yamlform.yamlform.test_draft.yml
+  - yamlform.yamlform.test_element_codemirror.yml
+  - yamlform.yamlform.test_element_test.yml
+  - yamlform.yamlform.test_form_closed.yml
+  - yamlform.yamlform.test_form_confidential.yml
+  - yamlform.yamlform.test_form_prepopulate.yml
+  - yamlform.yamlform.test_form_properties.yml
+  - yamlform.yamlform.test_form_submit_text.yml
+  - yamlform.yamlform.test_form_wizard.yml
+  - yamlform.yamlform.test_form_wizard_draft_preview.yml
+  - yamlform.yamlform.test_handler_email.yml
+  - yamlform.yamlform.test_handler_email_advanced.yml
+  - yamlform.yamlform.test_handler_test.yml
+  - yamlform.yamlform.test_inputs.yml
+  - yamlform.yamlform.test_inputs_dates.yml
+  - yamlform.yamlform.test_inputs_entity_autocomplete.yml
+  - yamlform.yamlform.test_inputs_formats.yml
+  - yamlform.yamlform.test_inputs_formats_tokens.yml
+  - yamlform.yamlform.test_inputs_ignored_properties.yml
+  - yamlform.yamlform.test_inputs_invalid.yml
+  - yamlform.yamlform.test_inputs_managed_file.yml
+  - yamlform.yamlform.test_inputs_private.yml
+  - yamlform.yamlform.test_inputs_text_format.yml
+  - yamlform.yamlform.test_inputs_unique.yml
+  - yamlform.yamlform.test_limit.yml
+  - yamlform.yamlform.test_options.yml
+  - yamlform.yamlform.test_preview.yml
+  - yamlform.yamlform.test_results_disabled.yml
diff --git a/yamlform.features.yml b/yamlform.features.yml
index f32a580..9ef7b90 100644
--- a/yamlform.features.yml
+++ b/yamlform.features.yml
@@ -1 +1,38 @@
-true
\ No newline at end of file
+required:
+  - core.base_field_override.node.yamlform.promote.yml
+  - core.entity_form_display.node.yamlform.default.yml
+  - core.entity_view_display.node.yamlform.default.yml
+  - core.entity_view_display.node.yamlform.teaser.yml
+  - field.field.node.yamlform.body.yml
+  - field.field.node.yamlform.yamlform.yml
+  - field.storage.node.yamlform.yml
+  - node.type.yamlform.yml
+  - yamlform.settings.yml
+  - yamlform.yamlform.contact.yml
+  - yamlform.yamlform.example_inputs.yml
+  - yamlform.yamlform.example_inputs_extras.yml
+  - yamlform.yamlform.example_inputs_formats.yml
+  - yamlform.yamlform.example_inputs_masks.yml
+  - yamlform.yamlform.example_inputs_states.yml
+  - yamlform.yamlform.example_layout_basic.yml
+  - yamlform.yamlform.example_options.yml
+  - yamlform.yamlform.example_wizard.yml
+  - yamlform.yamlform.template_job_application.yml
+  - yamlform.yamlform.template_registration.yml
+  - yamlform.yamlform.template_subscribe.yml
+  - yamlform.yamlform_options.country_codes.yml
+  - yamlform.yamlform_options.country_names.yml
+  - yamlform.yamlform_options.days.yml
+  - yamlform.yamlform_options.gender.yml
+  - yamlform.yamlform_options.likert_agreement.yml
+  - yamlform.yamlform_options.likert_comparison.yml
+  - yamlform.yamlform_options.likert_importance.yml
+  - yamlform.yamlform_options.likert_satisfaction.yml
+  - yamlform.yamlform_options.likert_ten_scale.yml
+  - yamlform.yamlform_options.likert_would_you.yml
+  - yamlform.yamlform_options.state_codes.yml
+  - yamlform.yamlform_options.state_names.yml
+  - yamlform.yamlform_options.state_province_codes.yml
+  - yamlform.yamlform_options.state_province_names.yml
+  - yamlform.yamlform_options.titles.yml
+  - yamlform.yamlform_options.yes_no.yml
diff --git a/yamlform.install b/yamlform.install
index f88c98c..8ccf4ec 100644
--- a/yamlform.install
+++ b/yamlform.install
@@ -200,7 +200,7 @@ function yamlform_update_8002(&$sandbox) {
  * Issue #2705859  Allow YAML form elements to define custom display formats. Add emptu formats to yamlform.settings.yml.
  */
 function yamlform_update_8003(&$sandbox) {
-  /** @var \Drupal\yamlform\YamlFormElementManager $element_manager */
+  /** @var \Drupal\yamlform\YamlFormElementManagerInterface $element_manager */
   $element_manager = \Drupal::service('plugin.manager.yamlform.element');
   $element_plugins = $element_manager->getInstances();
   $format = [];
diff --git a/yamlform.module b/yamlform.module
index de522d1..18b79b5 100755
--- a/yamlform.module
+++ b/yamlform.module
@@ -209,7 +209,8 @@ function _yamlform_form_config_translate_add_form_alter_yaml_element(array &$ele
     '#type' => 'yaml',
   ];
   unset($element['source']['#markup']);
-  $element['translation']['#type'] = 'yamlform_codemirror_yaml';
+  $element['translation']['#type'] = 'yamlform_codemirror';
+  $element['translation']['#mode'] = 'yaml';
 }
 
 /**
diff --git a/yamlform.theme.inc b/yamlform.theme.inc
index 10c18c2..02b275f 100644
--- a/yamlform.theme.inc
+++ b/yamlform.theme.inc
@@ -9,7 +9,8 @@ use Drupal\Core\Link;
 use Drupal\Component\Serialization\Yaml;
 use Drupal\yamlform\Utility\YamlFormTidy;
 use Drupal\yamlform\Utility\YamlFormDateHelper;
-use Drupal\yamlform\Element\YamlFormCodeMirrorBase;
+use Drupal\yamlform\Element\YamlFormCodeMirror;
+use Drupal\Component\Utility\Xss;
 
 /**
  * Prepares variables for yamlform templates.
@@ -196,7 +197,10 @@ function template_preprocess_yamlform_submission_yaml(array &$variables) {
   // Remove the pipe (|) after data: so that the 'data' is considered YAML and
   // not a string of text.
   $yaml = preg_replace('/^data: \|/m', 'data:', $yaml);
-  $variables['yaml'] = $yaml;
+  $variables['yaml'] = [
+    '#markup' => $yaml,
+    '#allowed_tags' => Xss::getAdminTagList(),
+  ];;
 }
 
 /**
@@ -210,7 +214,13 @@ function template_preprocess_yamlform_submission_yaml(array &$variables) {
  *   - type: The type of code.
  */
 function template_preprocess_yamlform_codemirror(array &$variables) {
-  $variables['mode'] = YamlFormCodeMirrorBase::getMode($variables['type']);
+  $variables['mode'] = YamlFormCodeMirror::getMode($variables['type']);
+  if (is_string($variables['code'])) {
+    $variables['code'] = [
+      '#markup' => $variables['code'],
+      '#allowed_tags' => Xss::getAdminTagList(),
+    ];
+  }
 }
 
 /**
diff --git a/yamlform.tokens.inc b/yamlform.tokens.inc
index c57db0c..959d1bd 100755
--- a/yamlform.tokens.inc
+++ b/yamlform.tokens.inc
@@ -153,7 +153,7 @@ function yamlform_tokens($type, $tokens, array $data, array $options, Bubbleable
     /** @var \Drupal\yamlform\YamlFormSubmissionViewBuilder $view_builder */
     $view_builder = \Drupal::entityManager()->getViewBuilder('yamlform_submission');
 
-    /** @var \Drupal\yamlform\YamlFormElementManager $element_manager */
+    /** @var \Drupal\yamlform\YamlFormElementManagerInterface $element_manager */
     $element_manager = \Drupal::service('plugin.manager.yamlform.element');
 
     $form_inputs = $yamlform_submission->getYamlForm()->getFlattenedInputs();
