diff --git a/config/menu_breadcrumb.menu.yml b/config/menu_breadcrumb.menu.yml
new file mode 100644
index 0000000..e69de29
diff --git a/lib/Drupal/menu_breadcrumb/Form/SettingsForm.php b/lib/Drupal/menu_breadcrumb/Form/SettingsForm.php
new file mode 100644
index 0000000..2fdef99
--- /dev/null
+++ b/lib/Drupal/menu_breadcrumb/Form/SettingsForm.php
@@ -0,0 +1,199 @@
+<?php
+
+namespace Drupal\menu_breadcrumb\Form;
+use Drupal\Core\Form\ConfigFormBase;
+
+class SettingsForm extends ConfigFormBase {
+
+  public function getFormId() {
+    return 'menu_breadcrumb_settings';
+  }
+
+
+  public function buildForm(array $form = array() , array &$form_state = array()) {
+    $config = $this->config('menu_breadcrumb.menu');
+    $form['determine_menu'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use menu the page belongs to for the breadcrumb.'),
+      '#description' => t('By default, Drupal will use the Navigation menu for the breadcrumb. If you want to use the menu the active page belongs to for the breadcrumb, enable this option.'),
+      '#default_value' => $config->get('determine_menu') == NULL ? 1 : $config->get('determine_menu'),
+    );
+
+
+    $form['append_node_title'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Append page title to breadcrumb'),
+      '#description' => t('Choose whether or not the page title should be included in the breadcrumb.'),
+      '#default_value' => $config->get('append_node_title')
+    );
+
+    $form['append_node_url'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Appended page title as an URL.'),
+      '#description' => t('Choose whether or not the appended page title should be an URL.'),
+      '#default_value' => $config->get('append_node_url'),
+    );
+
+    $form['hide_on_single_item'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Hide the breadcrumb if the breadcrumb only contains the link to the front page.'),
+      '#description' => t('Choose whether or not the breadcrumb should be hidden if the breadcrumb only contains a link to the front page (<em>Home</em>.).'),
+      '#default_value' => $config->get('hide_on_single_item'),
+    );
+
+    $form['include_exclude'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Enable / Disable Menus'),
+      '#description' => t('The breadcrumb will be generated from the first "enabled" menu that contains a menu item for the page. Re-order the list to change the priority of each menu.'),
+    );
+
+    $form['include_exclude']['note_about_navigation'] = array(
+      '#markup' => '<p class="description">' . t("Note: If none of the enabled menus contain an item for a given page, Drupal will look in the 'Navigation' menu by default, even if it is 'disabled' here.") . '</p>',
+    );
+
+    // Orderable list of menu selections.
+    $form['include_exclude']['menu_breadcrumb_menus'] = array(
+      '#tree' => TRUE,
+      '#theme' => 'menu_breadcrumb_menus_table',
+    );
+
+    $menus = _menu_breadcrumb_get_menus();
+    $weight_delta = count($menus);
+
+    foreach ($menus as $menu_name => $menu) {
+      // Load menu titles.
+      $title = !empty($menu['title']) ? $menu['title'] : $menu_name;
+
+      if ($menu['type'] == 'menu') {
+        $drupal_menu = menu_load($menu_name);
+        if (!empty($drupal_menu['title'])) {
+          $title = $drupal_menu['title'];
+        }
+      }
+
+
+      $safe_id_prefix = 'edit-menu-breadcrumb-menus-'. menu_breadcrumb_html_id($menu_name);
+      $form['include_exclude']['menu_breadcrumb_menus'][$menu_name] = array(
+        'enabled' => array(
+          '#type' => 'checkbox',
+          '#id' => $safe_id_prefix .'-enabled',
+          '#title' => '',
+          '#default_value' => $menu['enabled'],
+        ),
+        'label' => array(
+          '#value' => $menu_name,
+        ),
+        'weight' => array(
+          '#type' => 'weight',
+          '#default_value' => !empty($menu['weight']) ? (int) $menu['weight'] : 0,
+          '#delta' => $weight_delta,
+          '#id' => $safe_id_prefix .'-weight-wrapper',
+        ),
+        'type' => array(
+          '#type' => 'value',
+          '#value' => $menu['type'],
+        ),
+        'title' => array(
+          '#type' => 'value',
+          '#value' => $title,
+        ),
+        'title_display' => array(
+          '#type' => 'markup',
+          '#markup' => \Drupal\Component\Utility\String::checkPlain($title),
+        ),
+      );
+
+      // Provide helpful title attributes for special menus.
+      $title_field =& $form['include_exclude']['menu_breadcrumb_menus'][$menu_name]['title_display'];
+      if ($menu['type'] == 'pattern') {
+        $title_field['#value'] = t(
+          '<span title="@title">@name <em>(@hint)</em></span>',
+          array(
+            '@title' => t("See 'Advanced' settings below."),
+            '@name' => $title_field['#markup'],
+            '@hint' => t('pattern'),
+          )
+        );
+      }
+      elseif ($menu['type'] == 'menu_breadcrumb_default_menu') {
+        $title_field['#value'] = t(
+          '<em><span title="@title">@text</span></em>',
+          array(
+            '@title' => t('Default setting for future menus.'),
+            '@text' => t('Default setting (see below)'),
+          )
+        );
+      }
+    }
+
+    $form['include_exclude']['description'] = array(
+      '#type' => 'markup',
+      '#prefix' => '<p class="description">',
+      '#suffix' => '</p>',
+      '#value' => t('<strong>Default setting</strong> is not a real menu - it defines the default position and enabled status for future menus. If it is "enabled", Menu Breadcrumb will automatically consider newly-added menus when establishing breadcrumbs. If it is disabled, new menus will not be used for breadcrumbs until they have explicitly been enabled here.'),
+    );
+
+    $form['include_exclude']['advanced'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Advanced'),
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+    );
+
+    $form['include_exclude']['advanced']['pattern_help'] = array(
+      '#type' => 'markup',
+      '#prefix' => '<p class="description">',
+      '#suffix' => '</p>',
+      '#value' => t("Enter regular expressions (one per line) to aggregate matching menu names into a single replacement title in the above list."),
+    );
+
+    $form['include_exclude']['advanced']['menu_patterns'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Patterns'),
+      '#default_value' => $config->get('menu_patterns'),
+      '#description' => t("Syntax: /regex/title/<br/>e.g.: /^book-toc-\d+$/Books/"),
+    );
+    if (is_null($form['include_exclude']['advanced']['menu_patterns']['#default_value'])) {
+      $form['include_exclude']['advanced']['menu_patterns']['#default_value'] = MENU_BREADCRUMB_REGEX_DEFAULT;
+    }
+    return parent::buildForm($form, $form_state);
+  }
+
+
+  public function validateForm(array &$form, array &$form_state) {
+    $patterns =& $form_state['values']['menu_patterns'];
+
+    // Filter white-space before saving patterns.
+    $patterns = trim($patterns);
+    $patterns = preg_replace('/\s*[\r\n]+\s*/', "\n", $patterns);
+
+    // Check patterns against required syntax.
+    if ($patterns) {
+      foreach (explode("\n", $patterns) as $pattern) {
+        if (!preg_match(MENU_BREADCRUMB_REGEX_MATCH, $pattern)) {
+          $t_args = array(
+            '%pattern' => $pattern,
+            '%regex'   => MENU_BREADCRUMB_REGEX_MATCH
+          );
+          $this->setFormError('menu_patterns', $form_state, t("Invalid pattern syntax: %pattern does not match %regex", $t_args));
+        }
+      }
+    }
+    parent::validateForm($form, $form_state);
+  }
+
+
+  public function submitForm(array &$form, array &$form_state) {
+    $config = $this->config('menu_breadcrumb.menu')
+      ->set('pattern_matches_rebuild', TRUE)
+      ->set('determine_menu', $form_state['values']['determine_menu'])
+      ->set('append_node_title', $form_state['values']['append_node_title'])
+      ->set('append_node_url', $form_state['values']['append_node_url'])
+      ->set('hide_on_single_item', $form_state['values']['hide_on_single_item'])
+      ->set('menu_patterns', $form_state['values']['menu_patterns'])
+      ->set('menu_breadcrumb_menus', $form_state['values']['menu_breadcrumb_menus'])
+      ->save();
+    parent::submitForm($form, $form_state);
+  }
+
+}
diff --git a/menu_breadcrumb.info b/menu_breadcrumb.info
deleted file mode 100644
index d4443b7..0000000
--- a/menu_breadcrumb.info
+++ /dev/null
@@ -1,6 +0,0 @@
-name = Menu breadcrumb
-description = Allows you to use the menu the current page belongs to for the breadcrumb.
-dependencies[] = menu
-core = "7.x"
-files[] = menu_breadcrumb.install
-configure = admin/config/user-interface/menu-breadcrumb
diff --git a/menu_breadcrumb.info.yml b/menu_breadcrumb.info.yml
new file mode 100644
index 0000000..7b4c8b4
--- /dev/null
+++ b/menu_breadcrumb.info.yml
@@ -0,0 +1,6 @@
+name: Menu breadcrumb
+type: module
+description: 'Allows you to use the menu the current page belongs to for the breadcrumb.'
+version: VERSION
+core: 8.x
+configure: menu_breadcrumb.settings
diff --git a/menu_breadcrumb.install b/menu_breadcrumb.install
index a5e8ab4..06053df 100644
--- a/menu_breadcrumb.install
+++ b/menu_breadcrumb.install
@@ -1,40 +1,9 @@
 <?php
-/**
- * @file
- * Install file for the menu_breadcrumb module.
- */
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function menu_breadcrumb_uninstall() {
-  variable_del('menu_breadcrumb_append_node_title');
-  variable_del('menu_breadcrumb_append_node_url');
-  variable_del('menu_breadcrumb_determine_menu');
-  variable_del('menu_breadcrumb_hide_on_single_item');
-  variable_del('menu_breadcrumb_menu_patterns');
-  variable_del('menu_breadcrumb_menus');
-  variable_del('menu_breadcrumb_pattern_matches');
-  variable_del('menu_breadcrumb_pattern_matches_rebuild');
-}
-
-/**
- * If people are upgrading from a patched version based on drupal.org/node/303247
- * we'll try to catch it here. Will just notify and clear the variables for now.
- */
-function menu_breadcrumb_update_6100() {
-  // Remove deprecated filter variable, if it exists.
-  if (!is_null(variable_get('menu_breadcrumb_menus_filter', NULL))) {
-    variable_del('menu_breadcrumb_menus_filter');
-  }
-
-  // Require re-configuration of the menu list, if an incompatible
-  // menu_breadcrumb_default_menu variable exists.
-  $menus = variable_get('menu_breadcrumb_menus', array());
-  $incompatible = empty($menus['menu_breadcrumb_default_menu']);
-  if ($incompatible) {
-    drupal_set_message(t("Menu Breadcrumb's menu selection settings have changed recently. Please review the !settings and check that the correct menus are selected.", array('!settings' => l('Menu Breadcrumb settings', 'admin/settings/menu_breadcrumb'))), 'warning');
-    variable_del('menu_breadcrumb_menus');
-  }
-  return array();
-}
+  $config = Drupal::config('menu_breadcrumb.menu');
+  $config->delete();
+}
\ No newline at end of file
diff --git a/menu_breadcrumb.menu_links.yml b/menu_breadcrumb.menu_links.yml
new file mode 100644
index 0000000..f80c7b4
--- /dev/null
+++ b/menu_breadcrumb.menu_links.yml
@@ -0,0 +1,5 @@
+menu_breadcrumb.settings:
+  title: Menu Breadcrumb
+  description: 'Configure menu breadcrumb.'
+  route_name: menu_breadcrumb.settings
+  parent: system.admin_config_ui
diff --git a/menu_breadcrumb.module b/menu_breadcrumb.module
index 7c84ec9..9f73f7e 100644
--- a/menu_breadcrumb.module
+++ b/menu_breadcrumb.module
@@ -20,48 +20,105 @@ define('MENU_BREADCRUMB_REGEX_MATCH', '%^(/.+/)([^/]+)/$%');
  * Implementation of hook_help().
  */
 function menu_breadcrumb_help($path, $arg) {
-  $output = '';
-  switch ($path) {
-    case 'admin/config/modules#description':
-      $output = t('Allows you to use the menu the current page belongs to for the breadcrumb.');
-      break;
-    case 'admin/config/menu_breadcrumb':
-      $output = t('<p>By default, Drupal will use the Navigation menu for the breadcrumb. This module allows you to use the menu the current page belongs to for the breadcrumb.</p><p>As an added bonus, it also allows you to append the page title to the breadcrumb (either as a clickable url or not) and hide the breadcrumb if it only contains the link to the front page.</p>');
-      break;
-  }
+    $output = '';
+    switch ($path) {
+        case 'admin/config/modules#description':
+            $output = t('Allows you to use the menu the current page belongs to for the breadcrumb.');
+            break;
+        case 'admin/config/menu_breadcrumb':
+            $output = t('<p>By default, Drupal will use the Navigation menu for the breadcrumb. This module allows you to use the menu the current page belongs to for the breadcrumb.</p><p>As an added bonus, it also allows you to append the page title to the breadcrumb (either as a clickable url or not) and hide the breadcrumb if it only contains the link to the front page.</p>');
+            break;
+    }
 
-  return $output;
+    return $output;
 }
 
 /**
- * Implementation of hook_menu().
+ * Implementation of hook_theme().
  */
-function menu_breadcrumb_menu() {
-  $items['admin/config/user-interface/menu-breadcrumb'] = array(
-    'title' => 'Menu Breadcrumb',
-    'description' => 'Configure menu breadcrumb.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('menu_breadcrumb_admin_settings_form'),
-    'access arguments' => array('administer site configuration'),
-    'type' => MENU_NORMAL_ITEM,
+function menu_breadcrumb_theme() {
+  return array(
+    'menu_breadcrumb_menus_table' => array(
+      'render element' => 'form',
+    ),
   );
-  return $items;
 }
 
 /**
- * Default menu item.
- * If the module is not yet configured, we only need this
- * as a starting point. This determines the default weight
- * and 'enabled' status for any new menus.
+ * Theme a drag-to-reorder table of menu selection checkboxes.
  */
-function _menu_breadcrumb_default_menu() {
-  return array(
-    'menu_breadcrumb_default_menu' => array(
-      'enabled' => 1,
-      'weight'  => 0,
-      'type'    => 'menu_breadcrumb_default_menu',
-    ),
+function theme_menu_breadcrumb_menus_table($variables) {
+  $form = $variables['form'];
+  drupal_attach_tabledrag($form, array(
+    'action'       => 'order',
+    'relationship' => 'sibling',
+    'group'        => 'menu-weight',
+    'table_id'     => 'menu_breadcrumb_menus',
+  ));
+  $table['attributes']['id'] = 'menu-breadcrumb-menus' ;
+  $table['header'] = array(
+    t('Menu'),
+    t('Enabled'),
+    t('Weight'),
   );
+
+  // Generate table of draggable menu names.
+  $rows = array();
+  foreach (\Drupal\Core\Render\Element::children($form) as $key) {
+    if (isset($form[$key]['title_display'])) {
+      $menu = &$form[$key];
+      $row = array();
+      $row[] = drupal_render($menu['title_display']);
+      $row[] = drupal_render($menu['enabled']);
+      $menu['weight']['#attributes']['class'] = array('menu-weight');
+      $row[] = drupal_render($menu['weight']);
+      $rows[] = array('data' => $row, 'class' => array('draggable'));
+    }
+  }
+  $table['rows'] = $rows;
+  $table['caption'] = NULL;
+  $table['colgroups'] = array();
+  $table['sticky'] = FALSE;
+  $table['responsive'] = array();
+  $table['empty'] = '';
+  return theme_table($table);
+}
+
+/**
+ * Prepare a string for use as a valid HTML ID and guarantee uniqueness.
+ * Adapted from Drupal 7's drupal_html_id().
+ *
+ * @param $id
+ *   The ID to clean.
+ * @return
+ *   The cleaned ID.
+ */
+function menu_breadcrumb_html_id($id) {
+  static $seen_ids = array();
+  $id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
+
+  // As defined in http://www.w3.org/TR/html4/types.html#type-name, HTML IDs can
+  // only contain letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
+  // colons (":"), and periods ("."). We strip out any character not in that
+  // list. Note that the CSS spec doesn't allow colons or periods in identifiers
+  // (http://www.w3.org/TR/CSS21/syndata.html#characters), so we strip those two
+  // characters as well.
+  $id = preg_replace('/[^A-Za-z0-9\-_]/', '', $id);
+
+  // Ensure IDs are unique. The first occurrence is held but left alone.
+  // Subsequent occurrences get a number appended to them. This incrementing
+  // will almost certainly break code that relies on explicit HTML IDs in forms
+  // that appear more than once on the page, but the alternative is outputting
+  // duplicate IDs, which would break JS code and XHTML validity anyways. For
+  // now, it's an acceptable stopgap solution.
+  if (isset($seen_ids[$id])) {
+    $id = $id .'-'. ++$seen_ids[$id];
+  }
+  else {
+    $seen_ids[$id] = 1;
+  }
+
+  return $id;
 }
 
 /**
@@ -73,16 +130,24 @@ function _menu_breadcrumb_default_menu() {
 function _menu_breadcrumb_get_menus() {
   static $menus;
   if (!isset($menus)) {
+    $config = Drupal::config('menu_breadcrumb.menu');
     // Fetch stored or default settings.
-    $menus = variable_get('menu_breadcrumb_menus', _menu_breadcrumb_default_menu());
+    $menus = $config->get('menu_breadcrumb_menus');
+    if (empty($menus)) {
+      $menus = _menu_breadcrumb_default_menu();
+    }
 
     // Load the pattern match cache (to avoid any unnecessary regex matching).
     // Submitting the settings form requires us to rebuild this cache, as
     // the patterns may have changed.
-    $match_cache = variable_get('menu_breadcrumb_pattern_matches', array());
-    $match_cache_rebuild = variable_get('menu_breadcrumb_pattern_matches_rebuild', FALSE);
+    $match_cache = $config->get('pattern_matches');
+    if (empty($match_cache)) {
+      $match_cache = array();
+    }
+
+    $match_cache_rebuild = $config->get('pattern_matches_rebuild');
     if ($match_cache_rebuild) {
-      variable_set('menu_breadcrumb_pattern_matches_rebuild', FALSE);
+      $config->set('pattern_matches_rebuild', FALSE);
       $match_cache_old = $match_cache;
       $match_cache = array();
     }
@@ -93,7 +158,9 @@ function _menu_breadcrumb_get_menus() {
     // Find new/unknown menus. If rebuilding the pattern match cache,
     // we also treat previously-matched menus (i.e. those currently
     // 'replaced' by a pattern) as new.
-    $drupal_menu_names = menu_get_names();
+
+    $drupal_menu_names = menu_get_menus();
+
     $unknown_menu_names = array_diff($drupal_menu_names, array_keys($menus), array_keys($match_cache));
     if ($unknown_menu_names) {
       $new_menus = _menu_breadcrumb_process_unknown_menus($unknown_menu_names, $menus, $match_cache_old, $match_cache_rebuild);
@@ -117,17 +184,45 @@ function _menu_breadcrumb_get_menus() {
     // Remove any defunct menu names. Only visible if we are showing
     // the admin settings form, so don't waste time processing this
     // otherwise.
-    if ($_GET['q'] == 'admin/config/user-interface/menu-breadcrumb') {
+    if (_current_path() == 'admin/config/user-interface/menu-breadcrumb') {
       $current_menu_names = array_merge($drupal_menu_names, array_unique($match_cache), array('menu_breadcrumb_default_menu'));
       $menus_current = array_intersect(array_keys($menus), $current_menu_names);
       $menus = array_intersect_key($menus, array_flip($menus_current));
     }
   }
-
   return $menus;
 }
 
 /**
+ * Get the menu/selection list.
+ *
+ * @return
+ *   An array indicating the enabled status of each menu.
+ */
+function menu_breadcrumb_menu_list() {
+  static $list;
+
+  if (!isset($list)) {
+    $menus = _menu_breadcrumb_get_menus();
+    unset($menus['menu_breadcrumb_default_menu']);
+
+    $list = array();
+    foreach ($menus as $name => $menu) {
+      $list[$name] = (bool) $menu['enabled'];
+    }
+
+    // Enable other modules to dynamically modify the menu list
+    // (for example, to make the order depend upon the current
+    // user's language preference).
+    if ($hook = \Drupal::moduleHandler()->invokeAll('menu_breadcrumb_menu_list', $list)) {
+      $list = $hook;
+    }
+  }
+
+  return $list;
+}
+
+/**
  * Helper for _menu_breadcrumb_get_menus().
  * Determine whether each 'unknown' menu is genuinely new,
  * or was previously aggregated by a pattern match.
@@ -149,9 +244,9 @@ function _menu_breadcrumb_process_unknown_menus($unknown_menu_names, $menus, $ma
 
   foreach ($unknown_menu_names as $menu_name) {
     $previously_matched = ($match_cache_rebuild
-                          && array_key_exists($menu_name, $match_cache_old)
-                          && ($pattern = $match_cache_old[$menu_name])
-                          && array_key_exists($pattern, $menus));
+      && array_key_exists($menu_name, $match_cache_old)
+      && ($pattern = $match_cache_old[$menu_name])
+      && array_key_exists($pattern, $menus));
     if ($previously_matched) {
       // Use the known enabled/weight values for this pattern.
       $enabled = $menus[$pattern]['enabled'];
@@ -180,8 +275,12 @@ function _menu_breadcrumb_process_unknown_menus($unknown_menu_names, $menus, $ma
  */
 function _menu_breadcrumb_process_new_menus($new_menus, &$menus, &$match_cache, $match_cache_rebuild) {
   // Load the current regex patterns.
+  $config = Drupal::config('menu_breadcrumb.menu');
   $patterns = array();
-  $menu_patterns = variable_get('menu_breadcrumb_menu_patterns', MENU_BREADCRUMB_REGEX_DEFAULT);
+  $menu_patterns = $config->get('menu_patterns');
+  if (is_null($menu_patterns)) {
+    $menu_patterns = MENU_BREADCRUMB_REGEX_DEFAULT;
+  }
   $menu_patterns = array_filter(explode("\n", $menu_patterns));
   foreach ($menu_patterns as $pattern) {
     $part = array();
@@ -231,7 +330,7 @@ function _menu_breadcrumb_process_new_menus($new_menus, &$menus, &$match_cache,
       }
     }
     if ($update_match_cache) {
-      variable_set('menu_breadcrumb_pattern_matches', $match_cache);
+      $config->set('pattern_matches', $match_cache)->save();
     }
   }
 
@@ -242,7 +341,8 @@ function _menu_breadcrumb_process_new_menus($new_menus, &$menus, &$match_cache,
     $menus[$menu_name]['name'] = $menu_name;
   }
   uasort($menus, '_menu_breadcrumb_sort'); // sort by weight.
-  variable_set('menu_breadcrumb_menus', $menus);
+  $config->set('menus', $menus);
+  $config->save();
 }
 
 /**
@@ -261,73 +361,51 @@ function _menu_breadcrumb_sort($menu1, $menu2) {
 }
 
 /**
- * Get the menu/selection list.
- *
- * @return
- *   An array indicating the enabled status of each menu.
- */
-function menu_breadcrumb_menu_list() {
-  static $list;
-
-  if (!isset($list)) {
-    $menus = _menu_breadcrumb_get_menus();
-    unset($menus['menu_breadcrumb_default_menu']);
-
-    $list = array();
-    foreach ($menus as $name => $menu) {
-      $list[$name] = (bool) $menu['enabled'];
-    }
-
-    // Enable other modules to dynamically modify the menu list
-    // (for example, to make the order depend upon the current
-    // user's language preference).
-    if ($hook = module_invoke_all('menu_breadcrumb_menu_list', $list)) {
-      $list = $hook;
-    }
-  }
-
-  return $list;
-}
-
-/**
- * Implementation of hook_menu_breadcrumb_alter().
- *
- * Alter links in the active trail before it is rendered as the breadcrumb.
+ * Default menu item.
+ * If the module is not yet configured, we only need this
+ * as a starting point. This determines the default weight
+ * and 'enabled' status for any new menus.
  */
-function menu_breadcrumb_menu_breadcrumb_alter(&$active_trail, $item) {
-  // Removes "Home" link to the front page, in case you already have one.
-  if (variable_get('menu_breadcrumb_remove_home_link', FALSE) && $active_trail[0]['href'] === '<front>') {
-    array_shift($active_trail);
-  }
+function _menu_breadcrumb_default_menu() {
+  return array(
+    'menu_breadcrumb_default_menu' => array(
+      'enabled' => 1,
+      'weight'  => 0,
+      'type'    => 'menu_breadcrumb_default_menu',
+    ),
+  );
 }
 
 /**
- * Implementation of hook_init().
- *
- * Set the active menu according to the current path.
+ * Implements hook_system_breadcrumb_alter().
  */
-function menu_breadcrumb_init() {
+function menu_breadcrumb_system_breadcrumb_alter(array &$breadcrumb, array $attributes, array $context) {
   $is_front = drupal_is_front_page();
-  if (variable_get('menu_breadcrumb_determine_menu', 1) && !$is_front) {
-    // Find the set of menus containing a link for the current page.
-    $menu_item = menu_get_item();
-    $result = db_query("SELECT mlid, menu_name FROM {menu_links} WHERE link_path = :menu_item", array(':menu_item' => $menu_item['href']));
+  $config = \Drupal::config('menu_breadcrumb.menu');
+  if (!$is_front && (is_null($config->get('determine_menu')) || $config->get('determine_menu'))) {
+    $result = db_select('menu_links')
+      ->fields('menu_links', array('mlid', 'menu_name'))
+      ->condition('menu_links.machine_name', $attributes['_route'])
+      ->execute()
+      ->fetchAll();
     $menu_link_menus = array();
     foreach ($result as $menu_link) {
       $menu_link_menus[$menu_link->menu_name] = TRUE;
     }
 
     // Choose the highest-priority 'Enabled' menu.
-    $match_cache = variable_get('menu_breadcrumb_pattern_matches', array());
+    $match_cache = $config->get('pattern_matches');
+    if (is_null($match_cache)) {
+      $match_cache = array();
+    }
     $menu_list = array_filter(menu_breadcrumb_menu_list()); // enabled menus.
-
     foreach (array_keys($menu_list) as $menu_name) {
       $is_pattern = (substr($menu_name, 0, 1) == '/' && substr($menu_name, -1, 1) == '/');
       if ($is_pattern) {
         // Look for each of the $menu_link_menus in the pattern match cache.
         foreach (array_keys($menu_link_menus) as $menu_link_menu_name) {
           if (array_key_exists($menu_link_menu_name, $match_cache)
-              && $match_cache[$menu_link_menu_name] == $menu_name) {
+            && $match_cache[$menu_link_menu_name] == $menu_name) {
             menu_set_active_menu_names($menu_link_menu_name);
             break 2;
           }
@@ -345,300 +423,26 @@ function menu_breadcrumb_init() {
       }
     }
   }
-
   // Generate the breadcrumbs using the active menu.
-  $breadcrumb = drupal_get_breadcrumb();
-
-  if (variable_get('menu_breadcrumb_append_node_title', 0) == 1) {
-    $node_title = filter_xss(menu_get_active_title(), array());
-    if (variable_get('menu_breadcrumb_append_node_url', 0) == 1) {
-      $breadcrumb[] = $is_front ? l(t('Home'), '<front>') : l($node_title, $_GET['q'], array('html' => TRUE,));
+  if ($config->get('append_node_title') == 1) {
+    $node_title = NULL;
+    $active_trail = menu_get_active_trail();
+    foreach (array_reverse($active_trail) as $item) {
+      if (!(bool) ($item['type'] & MENU_IS_LOCAL_TASK)) {
+        $node_title = $item['title'];
+        break;
+      }
+    }
+    $node_title = filter_xss($node_title, array());
+    if ($config->get('append_node_url') == 1) {
+      $breadcrumb[] = $is_front ? l(t('Home'), '<front>') : l($node_title, $attributes['_system_path'], array('html' => TRUE,));
     }
     else {
       $breadcrumb[] = $is_front ? t('Home') : $node_title;
     }
   }
 
-  if (count($breadcrumb) == 1 && variable_get('menu_breadcrumb_hide_on_single_item', 0)) {
+  if (count($breadcrumb) == 1 && $config->get('hide_on_single_item')) {
     $breadcrumb = array();
   }
-
-  drupal_set_breadcrumb($breadcrumb);
-}
-
-/**
- * Menu breadcrumb admin settings form.
- *
- * @return
- *   The settings form used by Menu breadcrumb.
- */
-function menu_breadcrumb_admin_settings_form() {
-  $form['menu_breadcrumb_determine_menu'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Use menu the page belongs to for the breadcrumb.'),
-    '#description' => t('By default, Drupal will use the Navigation menu for the breadcrumb. If you want to use the menu the active page belongs to for the breadcrumb, enable this option.'),
-    '#default_value' => variable_get('menu_breadcrumb_determine_menu', 1),
-  );
-
-  $form['menu_breadcrumb_append_node_title'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Append page title to breadcrumb'),
-    '#description' => t('Choose whether or not the page title should be included in the breadcrumb.'),
-    '#default_value' => variable_get('menu_breadcrumb_append_node_title', 0),
-  );
-
-  $form['menu_breadcrumb_append_node_url'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Appended page title as an URL.'),
-    '#description' => t('Choose whether or not the appended page title should be an URL.'),
-    '#default_value' => variable_get('menu_breadcrumb_append_node_url', 0),
-  );
-
-  $form['menu_breadcrumb_hide_on_single_item'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Hide the breadcrumb if the breadcrumb only contains the link to the front page.'),
-    '#description' => t('Choose whether or not the breadcrumb should be hidden if the breadcrumb only contains a link to the front page (<em>Home</em>.).'),
-    '#default_value' => variable_get('menu_breadcrumb_hide_on_single_item', 0),
-  );
-
-  $form['menu_breadcrumb_remove_home_link'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Remove "Home" link.'),
-    '#description' => t('Removes "Home" link to the front page, in case you already have one.'),
-    '#default_value' => variable_get('menu_breadcrumb_remove_home_link', 0),
-  );
-
-  $form['include_exclude'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Enable / Disable Menus'),
-    '#description' => t('The breadcrumb will be generated from the first "enabled" menu that contains a menu item for the page. Re-order the list to change the priority of each menu.'),
-  );
-
-  $form['include_exclude']['note_about_navigation'] = array(
-    '#type' => 'markup',
-    '#prefix' => '<p class="description">',
-    '#suffix' => '</p>',
-    '#value' => t("Note: If none of the enabled menus contain an item for a given page, Drupal will look in the 'Navigation' menu by default, even if it is 'disabled' here."),
-  );
-
-  // Orderable list of menu selections.
-  $form['include_exclude']['menu_breadcrumb_menus'] = array(
-    '#tree' => TRUE,
-    '#theme' => 'menu_breadcrumb_menus_table',
-  );
-
-  // Load stored configuration.
-  $menus = _menu_breadcrumb_get_menus();
-  $weight_delta = count($menus);
-
-  foreach ($menus as $menu_name => $menu) {
-    // Load menu titles.
-    $title = !empty($menu['title']) ? $menu['title'] : $menu_name;
-    if ($menu['type'] == 'menu') {
-      $drupal_menu = menu_load($menu_name);
-      if (!empty($drupal_menu['title'])) {
-        $title = $drupal_menu['title'];
-      }
-    }
-
-    // Ensure that regex patterns do not cause invalid id attributes.
-    $safe_id_prefix = 'edit-menu-breadcrumb-menus-'. menu_breadcrumb_html_id($menu_name);
-
-    $form['include_exclude']['menu_breadcrumb_menus'][$menu_name] = array(
-      'enabled' => array(
-        '#type' => 'checkbox',
-        '#id' => $safe_id_prefix .'-enabled',
-        '#title' => '',
-        '#default_value' => $menu['enabled'],
-      ),
-      'label' => array(
-        '#value' => $menu_name,
-      ),
-      'weight' => array(
-        '#type' => 'weight',
-        '#default_value' => !empty($menu['weight']) ? (int) $menu['weight'] : 0,
-        '#delta' => $weight_delta,
-        '#id' => $safe_id_prefix .'-weight-wrapper',
-      ),
-      'type' => array(
-        '#type' => 'value',
-        '#value' => $menu['type'],
-      ),
-      'title' => array(
-        '#type' => 'value',
-        '#value' => $title,
-      ),
-      'title_display' => array(
-        '#type' => 'markup',
-        '#markup' => check_plain($title),
-      ),
-    );
-
-    // Provide helpful title attributes for special menus.
-    $title_field =& $form['include_exclude']['menu_breadcrumb_menus'][$menu_name]['title_display'];
-    if ($menu['type'] == 'pattern') {
-      $title_field['#value'] = t(
-        '<span title="@title">@name <em>(@hint)</em></span>',
-        array(
-          '@title' => t("See 'Advanced' settings below."),
-          '@name' => $title_field['#markup'],
-          '@hint' => t('pattern'),
-        )
-      );
-    }
-    elseif ($menu['type'] == 'menu_breadcrumb_default_menu') {
-      $title_field['#value'] = t(
-        '<em><span title="@title">@text</span></em>',
-        array(
-          '@title' => t('Default setting for future menus.'),
-          '@text' => t('Default setting (see below)'),
-        )
-      );
-    }
-  }
-
-  $form['include_exclude']['description'] = array(
-    '#type' => 'markup',
-    '#prefix' => '<p class="description">',
-    '#suffix' => '</p>',
-    '#value' => t('<strong>Default setting</strong> is not a real menu - it defines the default position and enabled status for future menus. If it is "enabled", Menu Breadcrumb will automatically consider newly-added menus when establishing breadcrumbs. If it is disabled, new menus will not be used for breadcrumbs until they have explicitly been enabled here.'),
-  );
-
-  $form['include_exclude']['advanced'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Advanced'),
-    '#collapsible' => TRUE,
-    '#collapsed' => TRUE,
-  );
-
-  $form['include_exclude']['advanced']['pattern_help'] = array(
-    '#type' => 'markup',
-    '#prefix' => '<p class="description">',
-    '#suffix' => '</p>',
-    '#value' => t("Enter regular expressions (one per line) to aggregate matching menu names into a single replacement title in the above list."),
-  );
-
-  $form['include_exclude']['advanced']['menu_breadcrumb_menu_patterns'] = array(
-    '#type' => 'textarea',
-    '#title' => t('Patterns'),
-    '#default_value' => variable_get('menu_breadcrumb_menu_patterns', MENU_BREADCRUMB_REGEX_DEFAULT),
-    '#description' => t("Syntax: /regex/title/<br/>e.g.: /^book-toc-\d+$/Books/"),
-  );
-
-  // Explicitly set our submit handler, due to system_settings_form().
-  $form['#submit'][] = 'menu_breadcrumb_admin_settings_form_submit';
-  return system_settings_form($form);
-}
-
-/**
- * Form validation handler.
- */
-function menu_breadcrumb_admin_settings_form_validate($form, &$form_state) {
-  $patterns =& $form_state['values']['menu_breadcrumb_menu_patterns'];
-
-  // Filter white-space before saving patterns.
-  $patterns = trim($patterns);
-  $patterns = preg_replace('/\s*[\r\n]+\s*/', "\n", $patterns);
-
-  // Check patterns against required syntax.
-  if ($patterns) {
-    foreach (explode("\n", $patterns) as $pattern) {
-      if (!preg_match(MENU_BREADCRUMB_REGEX_MATCH, $pattern)) {
-        $t_args = array(
-          '%pattern' => $pattern,
-          '%regex'   => MENU_BREADCRUMB_REGEX_MATCH
-        ) ;
-        form_set_error('menu_breadcrumb_menu_patterns', t("Invalid pattern syntax: %pattern does not match %regex", $t_args));
-      }
-    }
-  }
-}
-
-/**
- * Form submission handler.
- */
-function menu_breadcrumb_admin_settings_form_submit($form, &$form_state) {
-  // The menu pattern match cache needs rebuilding, as the
-  // pattern definitions may have changed.
-  variable_set('menu_breadcrumb_pattern_matches_rebuild', TRUE);
-}
-
-/**
- * Implementation of hook_theme().
- */
-function menu_breadcrumb_theme() {
-  return array(
-    'menu_breadcrumb_menus_table' => array(
-      'render element' => 'form',
-    ),
-  );
-}
-
-/**
- * Theme a drag-to-reorder table of menu selection checkboxes.
- */
-function theme_menu_breadcrumb_menus_table($variables) {
-  $form = $variables['form'];
-  drupal_add_tabledrag('menu-breadcrumb-menus', 'order', 'sibling', 'menu-weight');
-  $table['attributes']['id'] = 'menu-breadcrumb-menus' ;
-  $table['header'] = array(
-    t('Menu'),
-    t('Enabled'),
-    t('Weight'),
-  );
-
-  // Generate table of draggable menu names.
-  $rows = array();
-  foreach (element_children($form) as $key) {
-    if (isset($form[$key]['title_display'])) {
-      $menu = &$form[$key];
-      $row = array();
-      $row[] = drupal_render($menu['title_display']);
-      $row[] = drupal_render($menu['enabled']);
-      $menu['weight']['#attributes']['class'] = array('menu-weight');
-      $row[] = drupal_render($menu['weight']);
-      $rows[] = array('data' => $row, 'class' => array('draggable'));
-    }
-  }
-  $table['rows'] = $rows ;
-
-  return theme('table', $table);
-}
-
-/**
- * Prepare a string for use as a valid HTML ID and guarantee uniqueness.
- * Adapted from Drupal 7's drupal_html_id().
- *
- * @param $id
- *   The ID to clean.
- * @return
- *   The cleaned ID.
- */
-function menu_breadcrumb_html_id($id) {
-  static $seen_ids = array();
-  $id = strtr(drupal_strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
-
-  // As defined in http://www.w3.org/TR/html4/types.html#type-name, HTML IDs can
-  // only contain letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
-  // colons (":"), and periods ("."). We strip out any character not in that
-  // list. Note that the CSS spec doesn't allow colons or periods in identifiers
-  // (http://www.w3.org/TR/CSS21/syndata.html#characters), so we strip those two
-  // characters as well.
-  $id = preg_replace('/[^A-Za-z0-9\-_]/', '', $id);
-
-  // Ensure IDs are unique. The first occurrence is held but left alone.
-  // Subsequent occurrences get a number appended to them. This incrementing
-  // will almost certainly break code that relies on explicit HTML IDs in forms
-  // that appear more than once on the page, but the alternative is outputting
-  // duplicate IDs, which would break JS code and XHTML validity anyways. For
-  // now, it's an acceptable stopgap solution.
-  if (isset($seen_ids[$id])) {
-    $id = $id .'-'. ++$seen_ids[$id];
-  }
-  else {
-    $seen_ids[$id] = 1;
-  }
-
-  return $id;
-}
-
+}
\ No newline at end of file
diff --git a/menu_breadcrumb.routing.yml b/menu_breadcrumb.routing.yml
new file mode 100644
index 0000000..a1cf4b5
--- /dev/null
+++ b/menu_breadcrumb.routing.yml
@@ -0,0 +1,7 @@
+menu_breadcrumb.settings:
+  path: '/admin/config/user-interface/menu-breadcrumb'
+  defaults:
+    _title: 'Menu Breadcrumb'
+    _form: '\Drupal\menu_breadcrumb\Form\SettingsForm'
+  requirements:
+    _permission: 'administer site configuration'
