diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index e6810b8..f709f9f 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -1758,96 +1758,6 @@ function menu_list_system_menus() {
 }
 
 /**
- * Returns an array of links to be rendered as the Main menu.
- */
-function menu_main_menu() {
-  $config = config('menu.settings');
-  $menu_enabled = module_exists('menu');
-  // When menu module is not enabled, we need a hardcoded default value.
-  $main_links_source = $menu_enabled ? $config->get('main_links') : 'main';
-  return menu_navigation_links($main_links_source);
-}
-
-/**
- * Returns an array of links to be rendered as the Secondary links.
- */
-function menu_secondary_menu() {
-  $config = config('menu.settings');
-  $menu_enabled = module_exists('menu');
-  // When menu module is not enabled, we need a hardcoded default value.
-  $main_links_source = $menu_enabled ? $config->get('main_links') : 'main';
-  $secondary_links_source = $menu_enabled ? $config->get('secondary_links') : 'account';
-
-  // If the secondary menu source is set as the primary menu, we display the
-  // second level of the primary menu.
-  if ($secondary_links_source == $main_links_source) {
-    return menu_navigation_links($main_links_source, 1);
-  }
-  else {
-    return menu_navigation_links($secondary_links_source, 0);
-  }
-}
-
-/**
- * Returns an array of links for a navigation menu.
- *
- * @param $menu_name
- *   The name of the menu.
- * @param $level
- *   Optional, the depth of the menu to be returned.
- *
- * @return
- *   An array of links of the specified menu and level.
- */
-function menu_navigation_links($menu_name, $level = 0) {
-  // Don't even bother querying the menu table if no menu is specified.
-  if (empty($menu_name)) {
-    return array();
-  }
-
-  // Get the menu hierarchy for the current page.
-  $tree = menu_tree_page_data($menu_name, $level + 1);
-
-  // Go down the active trail until the right level is reached.
-  while ($level-- > 0 && $tree) {
-    // Loop through the current level's items until we find one that is in trail.
-    while ($item = array_shift($tree)) {
-      if ($item['link']['in_active_trail']) {
-        // If the item is in the active trail, we continue in the subtree.
-        $tree = empty($item['below']) ? array() : $item['below'];
-        break;
-      }
-    }
-  }
-
-  // Create a single level of links.
-  $router_item = menu_get_item();
-  $links = array();
-  foreach ($tree as $item) {
-    if (!$item['link']['hidden']) {
-      $class = '';
-      $l = $item['link']['localized_options'];
-      $l['href'] = $item['link']['href'];
-      $l['title'] = $item['link']['title'];
-      if ($item['link']['in_active_trail']) {
-        $class = ' active-trail';
-        $l['attributes']['class'][] = 'active-trail';
-      }
-      // Normally, l() compares the href of every link with the current path and
-      // sets the active class accordingly. But local tasks do not appear in
-      // menu trees, so if the current path is a local task, and this link is
-      // its tab root, then we have to set the class manually.
-      if ($item['link']['href'] == $router_item['tab_root_href'] && $item['link']['href'] != current_path()) {
-        $l['attributes']['class'][] = 'active';
-      }
-      // Keyed with the unique mlid to generate classes in theme_links().
-      $links['menu-' . $item['link']['mlid'] . $class] = $l;
-    }
-  }
-  return $links;
-}
-
-/**
  * Collects the local tasks (tabs), action links, and the root path.
  *
  * @param $level
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index bab2af5..81e4439 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2842,8 +2842,6 @@ function template_preprocess_page(&$variables) {
   $variables['language']          = $language_interface;
   $variables['language']->dir     = $language_interface->direction ? 'rtl' : 'ltr';
   $variables['logo']              = theme_get_setting('logo');
-  $variables['main_menu']         = theme_get_setting('toggle_main_menu') ? menu_main_menu() : array();
-  $variables['secondary_menu']    = theme_get_setting('toggle_secondary_menu') ? menu_secondary_menu() : array();
   $variables['action_links']      = menu_local_actions();
   $variables['site_name']         = (theme_get_setting('toggle_name') ? check_plain($site_config->get('name')) : '');
   $variables['site_slogan']       = (theme_get_setting('toggle_slogan') ? filter_xss_admin($site_config->get('slogan')) : '');
diff --git a/core/modules/menu/config/menu.settings.yml b/core/modules/menu/config/menu.settings.yml
index bd3574e..0b617f8 100644
--- a/core/modules/menu/config/menu.settings.yml
+++ b/core/modules/menu/config/menu.settings.yml
@@ -1,3 +1 @@
-main_links: main
-secondary_links: account
 override_parent_selector: '0'
diff --git a/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuNavigation.php b/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuNavigation.php
new file mode 100644
index 0000000..c9d4e6b
--- /dev/null
+++ b/core/modules/menu/lib/Drupal/menu/Plugin/block/block/MenuNavigation.php
@@ -0,0 +1,111 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\menu\Plugin\block\block\MenuNavigation.
+ */
+
+namespace Drupal\menu\Plugin\block\block;
+
+use Drupal\block\BlockBase;
+use Drupal\Core\Annotation\Plugin;
+use Drupal\Core\Annotation\Translation;
+
+/**
+ * Provides a navigation block for displaying menus at various depths.
+ *
+ * @Plugin(
+ *   id = "menu_navigation",
+ *   subject = @Translation("Menu Navigation"),
+ *   module = "menu"
+ * )
+ */
+class MenuNavigation extends BlockBase {
+
+  public function settings() {
+    return array(
+      'menu' => 'main',
+      'level' => 0,
+    );
+  }
+
+  public function blockForm($form, &$form_state) {
+    $form['menu'] = array(
+      '#type' => 'select',
+      '#title' => t('Source for the navigational links'),
+      '#default_value' => $this->configuration['menu'],
+      '#options' => menu_get_menus(),
+      '#description' => t('Select what should be displayed in this block as links.'),
+      '#required' => TRUE,
+    );
+
+    $form['level'] = array(
+      '#type' => 'select',
+      '#title' => t('The level of the navigational links to display.'),
+      '#default_value' => $this->configuration['level'],
+      '#options' => drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8)),
+      '#description' => t('Select what menu depth level to display.'),
+      '#required' => TRUE,
+    );
+
+    return $form;
+  }
+
+  public function blockSubmit($form, &$form_state) {
+    $this->setConfig('menu', $form_state['values']['menu']);
+    $this->setConfig('level', $form_state['values']['level']);
+  }
+
+  /**
+   * Implements \Drupal\block\BlockBase::build().
+   */
+  public function build() {
+    $configuration = $this->getConfig();
+    $menu_name = $configuration['menu'];
+    $level = $configuration['level'];
+    // Get the menu hierarchy for the current page.
+    $tree = menu_tree_page_data($menu_name, $level + 1);
+
+    // Go down the active trail until the right level is reached.
+    while ($level-- > 0 && $tree) {
+      // Loop through the current level's items until we find one that is in trail.
+      while ($item = array_shift($tree)) {
+        if ($item['link']['in_active_trail']) {
+          // If the item is in the active trail, we continue in the subtree.
+          $tree = empty($item['below']) ? array() : $item['below'];
+          break;
+        }
+      }
+    }
+
+    // Create a single level of links.
+    $router_item = menu_get_item();
+    $links = array();
+    foreach ($tree as $item) {
+      if (!$item['link']['hidden']) {
+        $class = '';
+        $l = $item['link']['localized_options'];
+        $l['href'] = $item['link']['href'];
+        $l['title'] = $item['link']['title'];
+        if ($item['link']['in_active_trail']) {
+          $class = ' active-trail';
+          $l['attributes']['class'][] = 'active-trail';
+        }
+        // Normally, l() compares the href of every link with the current path and
+        // sets the active class accordingly. But local tasks do not appear in
+        // menu trees, so if the current path is a local task, and this link is
+        // its tab root, then we have to set the class manually.
+        if ($item['link']['href'] == $router_item['tab_root_href'] && $item['link']['href'] != current_path()) {
+          $l['attributes']['class'][] = 'active';
+        }
+        // Keyed with the unique mlid to generate classes in theme_links().
+        $links['menu-' . $item['link']['mlid'] . $class] = $l;
+      }
+    }
+    return array(
+      '#theme' => 'links',
+      '#links' => $links
+    );
+  }
+
+}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 336f84b..8042c7c 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -2975,6 +2975,8 @@ function _system_rebuild_theme_data() {
   $defaults = array(
     'engine' => 'phptemplate',
     'regions' => array(
+      'account' => 'Account links',
+      'main_menu' => 'Main navigation',
       'sidebar_first' => 'Left sidebar',
       'sidebar_second' => 'Right sidebar',
       'content' => 'Content',
diff --git a/core/modules/system/templates/page.tpl.php b/core/modules/system/templates/page.tpl.php
index 6ddeeed..fd6e3cc 100644
--- a/core/modules/system/templates/page.tpl.php
+++ b/core/modules/system/templates/page.tpl.php
@@ -29,10 +29,6 @@
  *   in theme settings.
  *
  * Navigation:
- * - $main_menu (array): An array containing the Main menu links for the
- *   site, if they have been configured.
- * - $secondary_menu (array): An array containing the Secondary menu links for
- *   the site, if they have been configured.
  * - $breadcrumb: The breadcrumb trail for the current page.
  *
  * Page content (in order of occurrence in the default page.tpl.php):
@@ -56,6 +52,8 @@
  *   comment/reply/12345).
  *
  * Regions:
+ * - $page['account']: Items for the account region.
+ * - $page['main_menu']: Items for the main menu region.
  * - $page['help']: Dynamic help text, mostly for admin pages.
  * - $page['highlighted']: Items for the highlighted content region.
  * - $page['content']: The main content of the current page.
@@ -102,14 +100,18 @@
         </div><!-- #name-and-slogan -->
       <?php endif; ?>
 
+      <?php if ($page['account']): ?>
+        <nav role="navigation">
+          <?php print render($page['account']); ?>
+        </nav>
+      <?php endif; ?>
       <?php print render($page['header']); ?>
 
     </header>
 
-    <?php if ($main_menu || $secondary_menu): ?>
+    <?php if ($page['main_menu']): ?>
       <nav role="navigation">
-        <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => array('text' => t('Main menu'), 'class' => array('element-invisible')))); ?>
-        <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => array('text' => t('Secondary menu'), 'class' => array('element-invisible')))); ?>
+        <?php print render($page['main_menu']); ?>
       </nav>
     <?php endif; ?>
 
diff --git a/core/profiles/standard/config/block.block.bartik.primary_navigation.yml b/core/profiles/standard/config/block.block.bartik.primary_navigation.yml
new file mode 100644
index 0000000..04c9b85
--- /dev/null
+++ b/core/profiles/standard/config/block.block.bartik.primary_navigation.yml
@@ -0,0 +1,24 @@
+id: bartik.primary_navigation
+label: 'Primary Navigation'
+uuid: fb1697ef-bfcd-45b2-905a-906fda24b439
+region: main_menu
+weight: ''
+module: menu
+status: '1'
+visibility:
+  path:
+    visibility: '0'
+    pages: ''
+  role:
+    roles: {  }
+  node_type:
+    types:
+      article: '0'
+      page: '0'
+  visibility__active_tab: edit-visibility-path
+plugin: menu_navigation
+settings:
+  menu: main
+  level: '0'
+  subject: 'Menu Navigation'
+  cache: '-1'
diff --git a/core/profiles/standard/config/block.block.bartik.secondary_navigation.yml b/core/profiles/standard/config/block.block.bartik.secondary_navigation.yml
new file mode 100644
index 0000000..505e907
--- /dev/null
+++ b/core/profiles/standard/config/block.block.bartik.secondary_navigation.yml
@@ -0,0 +1,24 @@
+id: bartik.secondary_navigation
+label: 'Secondary navigation'
+uuid: 1ec67be5-c7b2-4769-ba08-8c17ca65f99e
+region: account
+weight: ''
+module: menu
+status: '1'
+visibility:
+  path:
+    visibility: '0'
+    pages: ''
+  role:
+    roles: {  }
+  node_type:
+    types:
+      article: '0'
+      page: '0'
+  visibility__active_tab: edit-visibility-path
+plugin: menu_navigation
+settings:
+  menu: account
+  level: '0'
+  subject: 'Menu Navigation'
+  cache: '-1'
diff --git a/core/themes/bartik/bartik.info b/core/themes/bartik/bartik.info
index c0c206d..acdc4d0 100644
--- a/core/themes/bartik/bartik.info
+++ b/core/themes/bartik/bartik.info
@@ -9,7 +9,9 @@ stylesheets[all][] = css/style.css
 stylesheets[all][] = css/colors.css
 stylesheets[print][] = css/print.css
 
+regions[account] = Account links
 regions[header] = Header
+regions[main_menu] = Main menu
 regions[help] = Help
 regions[page_top] = Page top
 regions[page_bottom] = Page bottom
diff --git a/core/themes/bartik/template.php b/core/themes/bartik/template.php
index 9a6c8a9..a0a33d1 100644
--- a/core/themes/bartik/template.php
+++ b/core/themes/bartik/template.php
@@ -151,3 +151,39 @@ function bartik_field__taxonomy_term_reference($variables) {
 
   return $output;
 }
+
+/**
+ * Implement hook_block_view_alter().
+ */
+function bartik_block_view_alter(&$build, $block) {
+  if ($block->get('id') == 'bartik.primary_navigation') {
+    $build['#block_config']['subject'] = '';
+    $build['#prefix'] = '<div id="main-menu" class="navigation" role="navigation">';
+    $build['#theme'] = 'links__system_main_menu';
+    $build['#attributes'] = array(
+      'id' => 'main-menu-links',
+      'class' => array('links', 'clearfix'),
+    );
+    $build['#heading'] = array(
+      'text' => t('Main menu'),
+      'level' => 'h2',
+      'class' => array('element-invisible'),
+    );
+    $build['#suffix'] = '</div> <!-- /#main-menu -->';
+  }
+  if ($block->get('id') == 'bartik.secondary_navigation') {
+    $build['#block_config']['subject'] = '';
+    $build['#prefix'] = '<div id="secondary-menu" class="navigation" role="navigation">';
+    $build['#theme'] = 'links__system_secondary_menu';
+    $build['#attributes'] = array(
+      'id' => 'secondary-menu-links',
+      'class' => array('links', 'inline', 'clearfix'),
+    );
+    $build['#heading'] = array(
+      'text' => t('Secondary menu'),
+      'level' => 'h2',
+      'class' => array('element-invisible'),
+    );
+    $build['#suffix'] = '</div> <!-- /#secondary-menu -->';
+  }
+}
diff --git a/core/themes/bartik/templates/page.tpl.php b/core/themes/bartik/templates/page.tpl.php
index 6f78e85..6eab79f 100644
--- a/core/themes/bartik/templates/page.tpl.php
+++ b/core/themes/bartik/templates/page.tpl.php
@@ -36,10 +36,6 @@
  *   make the site slogan visually hidden, but still accessible.
  *
  * Navigation:
- * - $main_menu (array): An array containing the Main menu links for the
- *   site, if they have been configured.
- * - $secondary_menu (array): An array containing the Secondary menu links for
- *   the site, if they have been configured.
  * - $breadcrumb: The breadcrumb trail for the current page.
  *
  * Page content (in order of occurrence in the default page.tpl.php):
@@ -63,7 +59,9 @@
  *   comment/reply/12345).
  *
  * Regions:
+ * - $page['account']: Items for the account region.
  * - $page['header']: Items for the header region.
+ * - $page['main_menu']: Items for the main menu region.
  * - $page['featured']: Items for the featured region.
  * - $page['highlighted']: Items for the highlighted content region.
  * - $page['help']: Dynamic help text, mostly for admin pages.
@@ -89,23 +87,8 @@
 ?>
 <div id="page-wrapper"><div id="page">
 
-  <div id="header" class="<?php print $secondary_menu ? 'with-secondary-menu': 'without-secondary-menu'; ?>" role="banner"><div class="section clearfix">
-    <?php if ($secondary_menu): ?>
-      <div id="secondary-menu" class="navigation" role="navigation">
-        <?php print theme('links__system_secondary_menu', array(
-          'links' => $secondary_menu,
-          'attributes' => array(
-            'id' => 'secondary-menu-links',
-            'class' => array('links', 'inline', 'clearfix'),
-          ),
-          'heading' => array(
-            'text' => t('Secondary menu'),
-            'level' => 'h2',
-            'class' => array('element-invisible'),
-          ),
-        )); ?>
-      </div> <!-- /#secondary-menu -->
-    <?php endif; ?>
+  <div id="header" role="banner"><div class="section clearfix">
+    <?php print render($page['account']); ?>
 
 
     <?php if ($logo): ?>
@@ -142,22 +125,7 @@
 
     <?php print render($page['header']); ?>
 
-    <?php if ($main_menu): ?>
-      <div id="main-menu" class="navigation" role="navigation">
-        <?php print theme('links__system_main_menu', array(
-          'links' => $main_menu,
-          'attributes' => array(
-            'id' => 'main-menu-links',
-            'class' => array('links', 'clearfix'),
-          ),
-          'heading' => array(
-            'text' => t('Main menu'),
-            'level' => 'h2',
-            'class' => array('element-invisible'),
-          ),
-        )); ?>
-      </div> <!-- /#main-menu -->
-    <?php endif; ?>
+    <?php print render($page['main_menu']); ?>
 
 
 
