diff --git a/core/includes/form.inc b/core/includes/form.inc
index c793f11..8aee8f0 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -4078,16 +4078,42 @@ function theme_vertical_tabs($variables) {
  * @code
  * '#autocomplete_path' => 'mymodule_autocomplete/' . $some_key . '/' . $some_id,
  * @endcode
+ * Or if your route is called 'mymodule_autocomplete' with the path of
+ * '/mymodule-autocomplete/{a}/{b}':
+ * @code
+ * '#autocomplete_route_name' => 'mymodule_autocomplete',
+ * '#autocomplete_route_parameters' => array('a' => $some_key, 'b' => $some_id),
+ * @endcode
  * The user types in "keywords" so the full path called is:
  * 'mymodule_autocomplete/$some_key/$some_id?q=keywords'
  *
- * @param $element
+ * @param array $element
  *   The form element to process. Properties used:
  *   - #autocomplete_path: A system path to be used as callback URL by the
  *     autocomplete JavaScript library.
+ *   - #autocomplete_route_name: A route to be used as callback URL by the
+ *     autocomplete JavaScript library.
+ *   - #autocomplete_route_parameters: The parameters to be used in conjunction
+ *     with the route name.
+ * @param array $form_state
+ *   An associative array containing the current state of the form.
+ *
+ * @return array
+ *   The form element.
  */
 function form_process_autocomplete($element, &$form_state) {
-  if (!empty($element['#autocomplete_path']) && drupal_valid_path($element['#autocomplete_path'])) {
+  $access = FALSE;
+  if (!empty($element['#autocomplete_route_name'])) {
+    $parameters = isset($element['#autocomplete_route_parameters']) ? $element['#autocomplete_route_parameters'] : array();
+
+    $path = Drupal::urlGenerator()->generate($element['#autocomplete_route_name'], $parameters);
+    $access = Drupal::service('access_manager')->checkNamedRoute($element['#autocomplete_route_name'], $parameters);
+  }
+  elseif (!empty($element['#autocomplete_path'])) {
+    $path = url($element['#autocomplete_path'], array('absolute' => TRUE));
+    $access = drupal_valid_path($element['#autocomplete_path']);
+  }
+  if ($access) {
     $element['#attributes']['class'][] = 'form-autocomplete';
     $element['#attached']['library'][] = array('system', 'drupal.autocomplete');
     // Provide a hidden element for the JavaScript behavior to bind to. Since
@@ -4097,7 +4123,7 @@ function form_process_autocomplete($element, &$form_state) {
     $element['autocomplete'] = array(
       '#type' => 'hidden',
       '#input' => FALSE,
-      '#value' => url($element['#autocomplete_path'], array('absolute' => TRUE)),
+      '#value' => $path,
       '#disabled' => TRUE,
       '#attributes' => array(
         'class' => array('autocomplete'),
diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 2486594..141eacd 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -1747,7 +1747,9 @@ function menu_get_active_help() {
     return '';
   }
 
-  $arg = drupal_help_arg(arg(NULL));
+  // Use the current path, which may have a language prefix.
+  $path = current_path();
+  $arg = drupal_help_arg(arg(NULL, $path));
 
   foreach (Drupal::moduleHandler()->getImplementations('help') as $module) {
     $function = $module . '_help';
diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
index 7660f77..b94d6a6 100644
--- a/core/lib/Drupal/Core/Ajax/AjaxResponse.php
+++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
@@ -133,15 +133,6 @@ protected function ajaxRender(Request $request) {
     $scripts = drupal_add_js();
     if (!empty($scripts['settings'])) {
       $settings = drupal_merge_js_settings($scripts['settings']['data']);
-      // During Ajax requests basic path-specific settings are excluded from
-      // new drupalSettings values. The original page where this request comes
-      // from already has the right values for the keys below. An Ajax request
-      // would update them with values for the Ajax request and incorrectly
-      // override the page's values.
-      // @see drupal_add_js
-      foreach (array('basePath', 'currentPath', 'scriptPath', 'pathPrefix') as $item) {
-        unset($settings[$item]);
-      }
       $this->addCommand(new SettingsCommand($settings, TRUE), TRUE);
     }
 
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index a45d338..a827cc9 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -210,7 +210,12 @@ public function deleteMultiple(array $cids) {
       while (count($cids));
     }
     catch (\Exception $e) {
-      $this->catchException($e);
+      // Create the cache table, which will be empty. This fixes cases during
+      // core install where a cache table is cleared before it is set
+      // with {cache_block} and {cache_menu}.
+      if (!$this->ensureBinExists()) {
+        $this->catchException($e);
+      }
     }
   }
 
@@ -242,7 +247,12 @@ public function deleteAll() {
       $this->connection->truncate($this->bin)->execute();
     }
     catch (\Exception $e) {
-      $this->catchException($e);
+      // Create the cache table, which will be empty. This fixes cases during
+      // core install where a cache table is cleared before it is set
+      // with {cache_block} and {cache_menu}.
+      if (!$this->ensureBinExists()) {
+        $this->catchException($e);
+      }
     }
   }
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
index e223942..b5cdca2 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
@@ -35,6 +35,13 @@ class Connection extends DatabaseConnection {
   const DATABASE_NOT_FOUND = 7;
 
   /**
+   * Last used cursor number.
+   *
+   * @var type int
+   */
+  private $_cursor_ctr;
+
+  /**
    * Constructs a connection object.
    */
   public function __construct(PDO $connection, array $connection_options) {
@@ -56,6 +63,8 @@ public function __construct(PDO $connection, array $connection_options) {
     if (isset($connection_options['init_commands'])) {
       $this->connection->exec(implode('; ', $connection_options['init_commands']));
     }
+
+    $this->_cursor_ctr = 0;
   }
 
   /**
@@ -132,6 +141,10 @@ public function query($query, array $args = array(), $options = array()) {
         $stmt->execute($args, $options);
       }
 
+      if (strpos($stmt->queryString,'SAVEPOINT mimic_innodb_not_released;') !== FALSE) {
+        $this->connection->prepare("RELEASE SAVEPOINT mimic_innodb_not_released")->execute();
+      }
+
       switch ($options['return']) {
         case Database::RETURN_STATEMENT:
           return $stmt;
@@ -146,6 +159,10 @@ public function query($query, array $args = array(), $options = array()) {
       }
     }
     catch (PDOException $e) {
+      if (preg_match("/SAVEPOINT (mimic_innodb_(released|not_released))/",$stmt->queryString,$matches)) {
+        $this->connection->prepare("ROLLBACK TO SAVEPOINT " . $matches[1])->execute();
+      }
+
       if ($options['throw_exception']) {
         // Match all SQLSTATE 23xxx errors.
         if (substr($e->getCode(), -6, -3) == '23') {
@@ -173,7 +190,27 @@ public function prepareQuery($query) {
     // @todo This workaround only affects bytea fields, but the involved field
     //   types involved in the query are unknown, so there is no way to
     //   conditionally execute this for affected queries only.
-    return parent::prepareQuery(preg_replace('/ ([^ ]+) +(I*LIKE|NOT +I*LIKE) /i', ' ${1}::text ${2} ', $query));
+    $query = preg_replace('/ ([^ ]+) +(I*LIKE|NOT +I*LIKE) /i', ' ${1}::text ${2} ', $query);
+
+    // While in transaction context, put a SAVEPOINT around every query that isn't
+    // itself a SAVEPOINT operation.  This means that a failed query can't cause
+    // the transaction to abort, which mimics the behavior of innodb.
+    if ($this->inTransaction() &&
+            (stripos($query,'SAVEPOINT ') === FALSE) &&
+            (stripos($query,'RELEASE ') === FALSE)) {
+      if (preg_match('/^[\s]*SELECT /i', $query)) {
+        // In the case of SELECT the SAVEPOINT can also be released in the same
+        // query.  Otherwise the RELEASE is a separate query.
+        $csr = 'csr' . $this->_cursor_ctr++;
+        $query = 'SAVEPOINT mimic_innodb_released; DECLARE '. $csr .' CURSOR FOR ' .
+                 $query . '; RELEASE SAVEPOINT mimic_innodb_released; FETCH ALL ' . $csr;
+      }
+      else {
+        $query = 'SAVEPOINT mimic_innodb_not_released; ' . $query;
+      }
+    }
+
+    return parent::prepareQuery($query);
   }
 
   public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
index bf9f23a..9963969 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
@@ -55,6 +55,10 @@ public function orderBy($field, $direction = 'ASC') {
     // Call parent function to order on this.
     $return = parent::orderBy($field, $direction);
 
+    if ($this->hasTag('pgsql_no_addfield_on_orderby')) {
+      return $return;
+    }
+
     // If there is a table alias specified, split it up.
     if (strpos($field, '.') !== FALSE) {
       list($table, $table_field) = explode('.', $field);
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Query.php b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php
index 6fbae92..ff95906 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Query.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Query.php
@@ -216,6 +216,7 @@ protected function addSort() {
     }
     // Now we know whether this is a simple query or not, actually do the
     // sorting.
+    $this->sqlQuery->addTag('pgsql_no_addfield_on_orderby');
     foreach ($sort as $key => $sql_alias) {
       $direction = $this->sort[$key]['direction'];
       if ($simple_query || isset($this->sqlGroupBy[$sql_alias])) {
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php
index c4174c8..0d17fa1 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/Block/CustomBlockBlock.php
@@ -10,10 +10,6 @@
 use Drupal\block\BlockBase;
 use Drupal\Component\Annotation\Plugin;
 use Drupal\Core\Annotation\Translation;
-use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
-use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\block\Plugin\Type\BlockManager;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Defines a generic custom block type.
@@ -25,55 +21,7 @@
  *  derivative = "Drupal\custom_block\Plugin\Derivative\CustomBlock"
  * )
  */
-class CustomBlockBlock extends BlockBase implements ContainerFactoryPluginInterface {
-
-  /**
-   * The Plugin Block Manager.
-   *
-   * @var \Drupal\block\Plugin\Type\BlockManager.
-   */
-  protected $blockManager;
-
-  /**
-   * The Module Handler.
-   *
-   * @var \Drupal\Core\Extension\ModuleHandlerInterface.
-   */
-  protected $moduleHandler;
-
-  /**
-   * Constructs a new CustomBlockBlock.
-   *
-   * @param array $configuration
-   *   A configuration array containing information about the plugin instance.
-   * @param string $plugin_id
-   *   The plugin ID for the plugin instance.
-   * @param array $plugin_definition
-   *   The plugin implementation definition.
-   * @param \Drupal\block\Plugin\Type\BlockManager
-   *   The Plugin Block Manager.
-   * @param \Drupal\Core\Extension\ModuleHandlerInterface
-   *   The Module Handler.
-   */
-  public function __construct(array $configuration, $plugin_id, array $plugin_definition, BlockManager $block_manager, ModuleHandlerInterface $module_handler) {
-    parent::__construct($configuration, $plugin_id, $plugin_definition);
-
-    $this->blockManager = $block_manager;
-    $this->moduleHandler = $module_handler;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) {
-    return new static(
-      $configuration,
-      $plugin_id,
-      $plugin_definition,
-      $container->get('plugin.manager.block'),
-      $container->get('module_handler')
-    );
-  }
+class CustomBlockBlock extends BlockBase {
 
   /**
    * Overrides \Drupal\block\BlockBase::settings().
@@ -113,8 +61,8 @@ public function blockForm($form, &$form_state) {
    */
   public function blockSubmit($form, &$form_state) {
     // Invalidate the block cache to update custom block-based derivatives.
-    if ($this->moduleHandler->moduleExists('block')) {
-      $this->blockManager->clearCachedDefinitions();
+    if (module_exists('block')) {
+      drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
     }
   }
 
diff --git a/core/modules/block/lib/Drupal/block/BlockAccessController.php b/core/modules/block/lib/Drupal/block/BlockAccessController.php
index 26716c2..a4827e5 100644
--- a/core/modules/block/lib/Drupal/block/BlockAccessController.php
+++ b/core/modules/block/lib/Drupal/block/BlockAccessController.php
@@ -8,47 +8,13 @@
 namespace Drupal\block;
 
 use Drupal\Core\Entity\EntityAccessController;
-use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Session\AccountInterface;
-use Drupal\Core\Path\AliasManagerInterface;
-use Drupal\Component\Utility\Unicode;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Provides a Block access controller.
  */
-class BlockAccessController extends EntityAccessController implements EntityControllerInterface {
-
-  /**
-   * The node grant storage.
-   *
-   * @var \Drupal\Core\Path\AliasManagerInterface
-   */
-  protected $aliasManager;
-
-  /**
-   * Constructs a BlockAccessController object.
-   *
-   * @param string $entity_type
-   *   The entity type of the access controller instance.
-   * @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
-   *   The alias manager.
-   */
-  public function __construct($entity_type, AliasManagerInterface $alias_manager) {
-    parent::__construct($entity_type);
-    $this->aliasManager = $alias_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
-    return new static(
-      $entity_type,
-      $container->get('path.alias_manager')
-    );
-  }
+class BlockAccessController extends EntityAccessController {
 
   /**
    * {@inheritdoc}
@@ -98,7 +64,7 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
       if ($visibility['path']['visibility'] < BLOCK_VISIBILITY_PHP) {
         // Compare the lowercase path alias (if any) and internal path.
         $path = current_path();
-        $path_alias = Unicode::strtolower($this->aliasManager->getPathAlias($path));
+        $path_alias = drupal_strtolower(drupal_container()->get('path.alias_manager')->getPathAlias($path));
         $page_match = drupal_match_path($path_alias, $pages) || (($path != $path_alias) && drupal_match_path($path, $pages));
         // When $block->visibility has a value of 0
         // (BLOCK_VISIBILITY_NOTLISTED), the block is displayed on all pages
diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
index 3cef2ff..ad4b9a0 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
@@ -87,7 +87,7 @@ public function form(array $form, array &$form_state) {
     if ($is_admin) {
       $form['author']['name']['#title'] = t('Authored by');
       $form['author']['name']['#description'] = t('Leave blank for %anonymous.', array('%anonymous' => \Drupal::config('user.settings')->get('anonymous')));
-      $form['author']['name']['#autocomplete_path'] = 'user/autocomplete';
+      $form['author']['name']['#autocomplete_route_name'] = 'user_autocomplete';
     }
     elseif ($user->isAuthenticated()) {
       $form['author']['name']['#type'] = 'item';
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php
index 08cc693..3374ddf 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php
@@ -274,7 +274,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
         '#type' => 'textfield',
         '#title' => t('Authored by'),
         '#maxlength' => 60,
-        '#autocomplete_path' => 'user/autocomplete',
+        '#autocomplete_route_name' => 'user_autocomplete',
         '#default_value' => $name,
         '#description' => t('Leave blank for %anonymous.', array('%anonymous' => variable_get('anonymous', t('Anonymous')))),
       );
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 045f1d9..08f54d1 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -190,7 +190,7 @@ public function form(array $form, array &$form_state) {
       '#type' => 'textfield',
       '#title' => t('Authored by'),
       '#maxlength' => 60,
-      '#autocomplete_path' => 'user/autocomplete',
+      '#autocomplete_route_name' => 'user_autocomplete',
       '#default_value' => !empty($node->name) ? $node->name : '',
       '#weight' => -1,
       '#description' => t('Leave blank for %anonymous.', array('%anonymous' => $user_config->get('anonymous'))),
diff --git a/core/modules/node/lib/Drupal/node/Plugin/Action/AssignOwnerNode.php b/core/modules/node/lib/Drupal/node/Plugin/Action/AssignOwnerNode.php
index 59255e2..7a2753c 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/Action/AssignOwnerNode.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/Action/AssignOwnerNode.php
@@ -107,7 +107,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
         '#type' => 'textfield',
         '#title' => t('Username'),
         '#default_value' => $owner_name,
-        '#autocomplete_path' => 'user/autocomplete',
+        '#autocomplete_route_name' => 'user_autocomplete',
         '#size' => '6',
         '#maxlength' => '60',
         '#description' => $description,
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
index cd5d89f..09e78a2 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
@@ -123,4 +123,26 @@ function testUnpublishedNodeCreation() {
     $this->assertRaw(t('!post %title has been created.', array('!post' => 'Basic page', '%title' => $edit["title"])));
   }
 
+  /**
+   * Tests the author autocompletion textfield.
+   */
+  public function testAuthorAutocomplete() {
+    $admin_user = $this->drupalCreateUser(array('administer nodes', 'create page content'));
+    $this->drupalLogin($admin_user);
+
+    $this->drupalGet('node/add/page');
+
+    $result = $this->xpath('//input[@id = "edit-name-autocomplete"]');
+    $this->assertEqual(count($result), 0, 'No autocompletion without access user profiles.');
+
+    $admin_user = $this->drupalCreateUser(array('administer nodes', 'create page content', 'access user profiles'));
+    $this->drupalLogin($admin_user);
+
+    $this->drupalGet('node/add/page');
+
+    $result = $this->xpath('//input[@id = "edit-name-autocomplete"]');
+    $this->assertEqual((string) $result[0]['value'], url('user/autocomplete'));
+    $this->assertEqual(count($result), 1, 'Ensure that the user does have access to the autocompletion');
+  }
+
 }
diff --git a/core/modules/system/lib/Drupal/system/Annotation/ImageToolkit.php b/core/modules/system/lib/Drupal/system/Annotation/ImageToolkit.php
deleted file mode 100644
index 0fd89da..0000000
--- a/core/modules/system/lib/Drupal/system/Annotation/ImageToolkit.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\system\Annotation\ImageToolkit.
- */
-
-namespace Drupal\system\Annotation;
-
-use Drupal\Component\Annotation\Plugin;
-
-/**
- * Defines a Plugin annotation object for the image toolkit plugin.
- *
- * @Annotation
- *
- * @see \Drupal\system\Plugin\ImageToolkitInterface
- * @see \Drupal\system\Plugin\ImageToolkitManager
- */
-class ImageToolkit extends Plugin {
-
-  /**
-   * The plugin ID.
-   *
-   * @var string
-   */
-  public $id;
-
-  /**
-   * The title of the image toolkit.
-   *
-   * The string should be wrapped in a @Translation().
-   *
-   * @ingroup plugin_translatable
-   *
-   * @var \Drupal\Core\Annotation\Translation
-   */
-  public $title;
-
-}
diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemController.php b/core/modules/system/lib/Drupal/system/Controller/SystemController.php
deleted file mode 100644
index 7054e95..0000000
--- a/core/modules/system/lib/Drupal/system/Controller/SystemController.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\system\Controller\SystemController.
- */
-
-namespace Drupal\system\Controller;
-
-use Drupal\Core\Controller\ControllerInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-use Symfony\Component\HttpFoundation\RedirectResponse;
-
-
-/**
- * Returns responses for System routes.
- */
-class SystemController implements ControllerInterface {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static();
-  }
-
-  /**
-   * Sets whether the admin menu is in compact mode or not.
-   *
-   * @param string $mode
-   *   Valid values are 'on' and 'off'.
-   *
-   * @return \Symfony\Component\HttpFoundation\RedirectResponse
-   */
-  function compactPage($mode) {
-    user_cookie_save(array('admin_compact_mode' => ($mode == 'on')));
-    return new RedirectResponse(url('<front>', array('absolute' => TRUE)));
-  }
-
-}
diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
index 3219edb..2421004 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkit/GDToolkit.php
@@ -8,7 +8,7 @@
 namespace Drupal\system\Plugin\ImageToolkit;
 
 use Drupal\Component\Plugin\PluginBase;
-use Drupal\system\Annotation\ImageToolkit;
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Core\Annotation\Translation;
 use Drupal\Core\Image\ImageInterface;
 use Drupal\system\Plugin\ImageToolkitInterface;
@@ -16,7 +16,7 @@
 /**
  * Defines the GD2 toolkit for image manipulation within Drupal.
  *
- * @ImageToolkit(
+ * @Plugin(
  *   id = "gd",
  *   title = @Translation("GD2 image manipulation toolkit")
  * )
diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php
index dc22c51..5f00afb 100644
--- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php
+++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitManager.php
@@ -28,8 +28,7 @@ class ImageToolkitManager extends DefaultPluginManager {
    *   The language manager.
    */
   public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManager $language_manager) {
-    $annotation_namespaces = array('Drupal\system\Annotation' => $namespaces['Drupal\system']);
-    parent::__construct('Plugin/ImageToolkit', $namespaces, $annotation_namespaces, 'Drupal\system\Annotation\ImageToolkit');
+    parent::__construct('Plugin/ImageToolkit', $namespaces);
     $this->setCacheBackend($cache_backend, $language_manager, 'image_toolkit');
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
index 119fc9a..7b86c56 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
@@ -29,7 +29,7 @@ public static function getInfo() {
   /**
    * Ensures ajax_render() returns JavaScript settings from the page request.
    */
-  public function testAJAXRender() {
+  function testAJAXRender() {
     // Verify that settings command is generated when JavaScript settings are
     // set via drupal_add_js().
     $commands = $this->drupalGetAJAX('ajax-test/render');
@@ -40,7 +40,7 @@ public function testAJAXRender() {
   /**
    * Tests AjaxResponse::prepare() AJAX commands ordering.
    */
-  public function testOrder() {
+  function testOrder() {
     $path = drupal_get_path('module', 'system');
     $expected_commands = array();
 
@@ -82,7 +82,7 @@ public function testOrder() {
   /**
    * Tests behavior of ajax_render_error().
    */
-  public function testAJAXRenderError() {
+  function testAJAXRenderError() {
     // Verify custom error message.
     $edit = array(
       'message' => 'Custom error message.',
@@ -95,7 +95,7 @@ public function testAJAXRenderError() {
   /**
    * Tests that new JavaScript and CSS files are lazy-loaded on an AJAX request.
    */
-  public function testLazyLoad() {
+  function testLazyLoad() {
     $expected = array(
       'setting_name' => 'ajax_forms_test_lazy_load_form_submit',
       'setting_value' => 'executed',
@@ -183,21 +183,9 @@ public function testLazyLoad() {
   }
 
   /**
-   * Tests that drupalSettings.currentPath is not updated on AJAX requests.
-   */
-  public function testCurrentPathChange() {
-    $commands = $this->drupalPostAJAX('ajax_forms_test_lazy_load_form', array('add_files' => FALSE), array('op' => t('Submit')));
-    foreach ($commands as $command) {
-      if ($command['command'] == 'settings') {
-        $this->assertFalse(isset($command['settings']['currentPath']), 'Value of drupalSettings.currentPath is not updated after an AJAX request.');
-      }
-    }
-  }
-
-  /**
    * Tests that overridden CSS files are not added during lazy load.
    */
-  public function testLazyLoadOverriddenCSS() {
+  function testLazyLoadOverriddenCSS() {
     // The test theme overrides system.module.css without an implementation,
     // thereby removing it.
     theme_enable(array('test_theme'));
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php
index e3521cc..be13136 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/ElementTest.php
@@ -126,4 +126,28 @@ function testGroupElements() {
     $elements = $this->xpath('//div[@class="vertical-tabs-panes"]//details[@id="edit-meta-2"]//label');
     $this->assertTrue(count($elements) == 1);
   }
+
+  /**
+   * Tests a form with a autocomplete setting..
+   */
+  public function testFormAutocomplete() {
+    $this->drupalGet('form-test/autocomplete');
+
+    $result = $this->xpath('//input[@id = "edit-autocomplete-1-autocomplete"]');
+    $this->assertEqual(count($result), 0, 'Ensure that the user does not have access to the autocompletion');
+    $result = $this->xpath('//input[@id = "edit-autocomplete-2-autocomplete"]');
+    $this->assertEqual(count($result), 0, 'Ensure that the user did not had access to the autocompletion');
+
+    $user = $this->drupalCreateUser(array('access autocomplete test'));
+    $this->drupalLogin($user);
+    $this->drupalGet('form-test/autocomplete');
+
+    $result = $this->xpath('//input[@id = "edit-autocomplete-1-autocomplete"]');
+    $this->assertEqual((string) $result[0]['value'], url('form-test/autocomplete-1'));
+    $this->assertEqual(count($result), 1, 'Ensure that the user does have access to the autocompletion');
+    $result = $this->xpath('//input[@id = "edit-autocomplete-2-autocomplete"]');
+    $this->assertEqual((string) $result[0]['value'], url('form-test/autocomplete-2/value'));
+    $this->assertEqual(count($result), 1, 'Ensure that the user does have access to the autocompletion');
+  }
+
 }
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index bd58f93..6a8478f 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -627,6 +627,13 @@ function system_menu() {
     'menu_name' => 'admin',
     'file' => 'system.admin.inc',
   );
+  $items['admin/compact'] = array(
+    'title' => 'Compact mode',
+    'page callback' => 'system_admin_compact_page',
+    'access arguments' => array('access administration pages'),
+    'type' => MENU_CALLBACK,
+    'file' => 'system.admin.inc',
+  );
   $items['admin/tasks'] = array(
     'title' => 'Tasks',
     'type' => MENU_DEFAULT_LOCAL_TASK,
@@ -2940,14 +2947,14 @@ function confirm_form($form, $question, $path, $description = NULL, $yes = NULL,
  * such as the configuration page and the permissions page.
  *
  * Whether the user is in compact mode is determined by a cookie, which is set
- * for the user by \Drupal\system\Controller\SystemController::compactPage().
+ * for the user by system_admin_compact_page().
  *
  * If the user does not have the cookie, the default value is given by the
  * system variable 'admin_compact_mode', which itself defaults to FALSE. This
  * does not have a user interface to set it: it is a hidden variable which can
  * be set in the settings.php file.
  *
- * @return bool
+ * @return
  *   TRUE when in compact mode, FALSE when in expanded mode.
  */
 function system_admin_compact_mode() {
@@ -2957,6 +2964,17 @@ function system_admin_compact_mode() {
 }
 
 /**
+ * Menu callback; Sets whether the admin menu is in compact mode or not.
+ *
+ * @param $mode
+ *   Valid values are 'on' and 'off'.
+ */
+function system_admin_compact_page($mode = 'off') {
+  user_cookie_save(array('admin_compact_mode' => ($mode == 'on')));
+  return new RedirectResponse(url('<front>', array('absolute' => TRUE)));
+}
+
+/**
  * Generate a list of tasks offered by a specified module.
  *
  * @param $module
diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml
index 254bf01..017d486 100644
--- a/core/modules/system/system.routing.yml
+++ b/core/modules/system/system.routing.yml
@@ -10,15 +10,6 @@ system.cron:
     _controller: '\Drupal\system\CronController::run'
   requirements:
     _access_system_cron: 'TRUE'
-
-system_admin_compact_page:
-  pattern: '/admin/compact/{mode}'
-  defaults:
-    _controller: 'Drupal\system\Controller\SystemController::compactPage'
-    mode: 'off'
-  requirements:
-    _permission: 'access administration pages'
-
 system.machine_name_transliterate:
   pattern: '/machine_name/transliterate'
   defaults:
diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
index 291f7bb..67f5322 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
+++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
@@ -534,13 +534,6 @@ function ajax_forms_test_validation_number_form_callback($form, $form_state) {
  * Form builder: Builds a form that triggers a simple AJAX callback.
  */
 function ajax_forms_test_lazy_load_form($form, &$form_state) {
-  // We attach a JavaScript setting, so that one of the generated AJAX commands
-  // will be a settings command. We can then check the settings command to
-  // ensure that the 'currentPath' setting is not part of the Ajax response.
-  $form['#attached']['js'][] = array(
-    'type' => 'setting',
-    'data' => array('test' => 'currentPathUpdate'),
-  );
   $form['add_files'] = array(
     '#type' => 'checkbox',
     '#default_value' => FALSE,
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index 762d7fc..fa16bf9 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -376,6 +376,9 @@ function form_test_permission() {
     'access vertical_tab_test tabs' => array(
       'title' => t('Access vertical_tab_test tabs'),
     ),
+    'access autocomplete test' => array(
+      'title' => t('Access autocomplete test'),
+    ),
   );
   return $perms;
 }
diff --git a/core/modules/system/tests/modules/form_test/form_test.routing.yml b/core/modules/system/tests/modules/form_test/form_test.routing.yml
index 0091561..34e437d 100644
--- a/core/modules/system/tests/modules/form_test/form_test.routing.yml
+++ b/core/modules/system/tests/modules/form_test/form_test.routing.yml
@@ -46,3 +46,24 @@ form_test.route7:
     _form: '\Drupal\form_test\ConfirmFormArrayPathTestForm'
   requirements:
     _access: 'TRUE'
+
+form_test.route8:
+  pattern: '/form-test/autocomplete'
+  defaults:
+    _form: '\Drupal\form_test\FormTestAutocompleteForm'
+  requirements:
+    _access: 'TRUE'
+
+form_test.autocomplete_1:
+  pattern: '/form-test/autocomplete-1'
+  defaults:
+    controller: '\Drupal\form_test\AutocompleteController::autocomplete1'
+  requirements:
+    _permission: 'access autocomplete test'
+
+form_test.autocomplete_2:
+  pattern: '/form-test/autocomplete-2/{param}'
+  defaults:
+    controller: '\Drupal\form_test\AutocompleteController::autocomplete1'
+  requirements:
+    _permission: 'access autocomplete test'
diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/AutocompleteController.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/AutocompleteController.php
new file mode 100644
index 0000000..203f40f
--- /dev/null
+++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/AutocompleteController.php
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\form_test\AutocompleteController.
+ */
+
+namespace Drupal\form_test;
+
+use Symfony\Component\HttpFoundation\JsonResponse;
+
+/**
+ * Defines a controller class with methods for autocompletion.
+ */
+class AutocompleteController {
+
+  /**
+   * Returns some autocompletion content.
+   *
+   * @return \Symfony\Component\HttpFoundation\JsonResponse
+   *   A JSON response.
+   */
+  public function autocomplete1() {
+    return new JsonResponse(array('key' => 'value'));
+  }
+
+}
diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestAutocompleteForm.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestAutocompleteForm.php
new file mode 100644
index 0000000..fb38218
--- /dev/null
+++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/FormTestAutocompleteForm.php
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\form_test\FormTestAutocompleteForm.
+ */
+
+namespace Drupal\form_test;
+
+use Drupal\Core\Form\FormInterface;
+
+/**
+ * Defines a test form using autocomplete textfields.
+ */
+class FormTestAutocompleteForm implements FormInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormID() {
+    return 'form_test_autocomplete';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, array &$form_state) {
+    $form['autocomplete_1'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Autocomplete 1',
+      '#autocomplete_route_name' => 'form_test.autocomplete_1',
+    );
+    $form['autocomplete_2'] = array(
+      '#type' => 'textfield',
+      '#title' => 'Autocomplete 2',
+      '#autocomplete_route_name' => 'form_test.autocomplete_2',
+      '#autocomplete_route_parameters' => array('param' => 'value'),
+    );
+
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function validateForm(array &$form, array &$form_state) {
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, array &$form_state) {
+  }
+
+}
diff --git a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/BrokenToolkit.php b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/BrokenToolkit.php
index b7aeef5..158083c 100644
--- a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/BrokenToolkit.php
+++ b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/BrokenToolkit.php
@@ -7,13 +7,13 @@
 
 namespace Drupal\image_test\Plugin\ImageToolkit;
 
-use Drupal\system\Annotation\ImageToolkit;
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Core\Annotation\Translation;
 
 /**
  * Defines a Test toolkit for image manipulation within Drupal.
  *
- * @ImageToolkit(
+ * @Plugin(
  *   id = "broken",
  *   title = @Translation("A dummy toolkit that is broken")
  * )
diff --git a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php
index eede36a..7f1492f 100644
--- a/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php
+++ b/core/modules/system/tests/modules/image_test/lib/Drupal/image_test/Plugin/ImageToolkit/TestToolkit.php
@@ -8,7 +8,7 @@
 namespace Drupal\image_test\Plugin\ImageToolkit;
 
 use Drupal\Component\Plugin\PluginBase;
-use Drupal\system\Annotation\ImageToolkit;
+use Drupal\Component\Annotation\Plugin;
 use Drupal\Core\Annotation\Translation;
 use Drupal\Core\Image\ImageInterface;
 use Drupal\system\Plugin\ImageToolkitInterface;
@@ -16,7 +16,7 @@
 /**
  * Defines a Test toolkit for image manipulation within Drupal.
  *
- * @ImageToolkit(
+ * @Plugin(
  *   id = "test",
  *   title = @Translation("A dummy toolkit that works")
  * )
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php
index 3742917..0f633a6 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php
@@ -42,7 +42,7 @@ protected function valueForm(&$form, &$form_state) {
       '#title' => t('Usernames'),
       '#description' => t('Enter a comma separated list of user names.'),
       '#default_value' => $default_value,
-      '#autocomplete_path' => 'user/autocomplete/anonymous',
+      '#autocomplete_route_name' => 'user_autocomplete_anonymous',
     );
 
     if (!empty($form_state['exposed']) && !isset($form_state['input'][$this->options['expose']['identifier']])) {
diff --git a/core/modules/views/lib/Drupal/views/ViewStorageController.php b/core/modules/views/lib/Drupal/views/ViewStorageController.php
index 087d34e..e88cd27 100644
--- a/core/modules/views/lib/Drupal/views/ViewStorageController.php
+++ b/core/modules/views/lib/Drupal/views/ViewStorageController.php
@@ -34,7 +34,7 @@ public function loadMultiple(array $ids = NULL) {
    * {@inheritdoc}
    */
   protected function attachLoad(&$queried_entities, $revision_id = FALSE) {
-    foreach ($queried_entities as $entity) {
+    foreach ($queried_entities as $id => $entity) {
       $entity->mergeDefaultDisplaysOptions();
     }
 
diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css
index dab43ff..2253074 100644
--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.css
@@ -859,10 +859,6 @@ ul.links {
   border-right: 1px solid #fff4f4;
 }
 
-.comment-footer {
-  display: table-row;
-}
-
 /* ------------------ Sidebar ----------------- */
 .sidebar .section {
   padding-top: 10px;
diff --git a/core/themes/bartik/templates/comment.html.twig b/core/themes/bartik/templates/comment.html.twig
index 2671268..2a8351c 100644
--- a/core/themes/bartik/templates/comment.html.twig
+++ b/core/themes/bartik/templates/comment.html.twig
@@ -66,6 +66,7 @@
 <article class="{{ attributes.class }} clearfix"{{ attributes }} role="article">
 
   <header class="comment-header">
+
     <div class="attribution">
       {{ user_picture }}
 
@@ -91,36 +92,38 @@
         {% endif %}
       </div>
     </div> <!-- /.attribution -->
-  </header> <!-- /.comment-header -->
 
-  <div class="comment-text">
-    <div class="comment-arrow"></div>
+    <div class="comment-text">
+      <div class="comment-arrow"></div>
 
-    {% if new %}
-      <span class="new">{{ new }}</span>
-    {% endif %}
+      {% if new %}
+        <span class="new">{{ new }}</span>
+      {% endif %}
+
+      {{ title_prefix }}
+      <h3{{ title_attributes }}>{{ title }}</h3>
+      {{ title_suffix }}
+    </div> <!-- /.comment-text -->
 
-    {{ title_prefix }}
-    <h3{{ title_attributes }}>{{ title }}</h3>
-    {{ title_suffix }}
+  </header> <!-- /.comment-header -->
 
-    <div{{ content_attributes }}>
-      {# We hide the links now so that we can render them later. #}
-      {% hide(content.links) %}
-      {{ content }}
-    </div> <!-- /.content -->
+  <div{{ content_attributes }}>
+    {# We hide the links now so that we can render them later. #}
+    {% hide(content.links) %}
+    {{ content }}
 
-    <footer class="comment-footer">
-      {% if signature %}
-      <div class="user-signature clearfix">
-        {{ signature }}
-      </div>
-      {% endif %}
+  </div> <!-- /.content -->
+
+  <footer class="comment-footer">
+    {% if signature %}
+    <div class="user-signature clearfix">
+      {{ signature }}
+    </div>
+    {% endif %}
 
-      <nav>
-        {{ content.links }}
-      </nav>
-    </footer> <!-- /.comment-footer -->
-  </div> <!-- /.comment-text -->
+    <nav>
+      {{ content.links }}
+    </nav>
+  </footer> <!-- /.comment-footer -->
 
 </article>
