diff --git a/core/modules/views/lib/Drupal/views/Plugin/ViewsHandlerManager.php b/core/modules/views/lib/Drupal/views/Plugin/ViewsHandlerManager.php
index 3f13901..35b02ea 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/ViewsHandlerManager.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/ViewsHandlerManager.php
@@ -130,4 +130,14 @@ public function getHandler($item, $override = NULL) {
     return $this->createInstance('broken', array('optional' => $optional, 'original_configuration' => $item));
   }
 
+  public function createInstance($plugin_id, array $configuration = array()) {
+    $instance = parent::createInstance($plugin_id, $configuration);
+    if ($instance instanceof HandlerBase) {
+      $instance->setModuleHandler($this->moduleHandler);
+      $instance->setViewsData($this->viewsData);
+    }
+    return $instance;
+  }
+
+
 }
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
index be0aed9..b6d72af 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
@@ -11,6 +11,7 @@
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\UrlHelper;
 use Drupal\Component\Utility\Xss;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\views\Plugin\views\display\DisplayPluginBase;
@@ -18,6 +19,7 @@
 use Drupal\views\ViewExecutable;
 use Drupal\Core\Database\Database;
 use Drupal\views\Views;
+use Drupal\views\ViewsData;
 
 abstract class HandlerBase extends PluginBase {
 
@@ -86,6 +88,20 @@
   protected $optional = FALSE;
 
   /**
+   * The module handler.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * The views data service.
+   *
+   * @var \Drupal\views\ViewsData
+   */
+  protected $viewsData;
+
+  /**
    * Constructs a Handler object.
    */
   public function __construct(array $configuration, $plugin_id, array $plugin_definition) {
@@ -174,7 +190,7 @@ public function adminLabel($short = FALSE) {
       return $title;
     }
     $title = ($short && isset($this->definition['title short'])) ? $this->definition['title short'] : $this->definition['title'];
-    return t('!group: !title', array('!group' => $this->definition['group'], '!title' => $title));
+    return $this->t('!group: !title', array('!group' => $this->definition['group'], '!title' => $title));
   }
 
   /**
@@ -260,11 +276,11 @@ protected function caseTransform($string, $option) {
       default:
         return $string;
       case 'upper':
-        return drupal_strtoupper($string);
+        return Unicode::strtoupper($string);
       case 'lower':
-        return drupal_strtolower($string);
+        return Unicode::strtolower($string);
       case 'ucfirst':
-        return drupal_strtoupper(drupal_substr($string, 0, 1)) . drupal_substr($string, 1);
+        return Unicode::ucfirst($string);
       case 'ucwords':
         if (Unicode::getStatus() == Unicode::STATUS_MULTIBYTE) {
           return mb_convert_case($string, MB_CASE_TITLE);
@@ -299,8 +315,8 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
     $form['admin_label']['admin_label'] = array(
       '#type' => 'textfield',
-      '#title' => t('Administrative title'),
-      '#description' => t('This title will be displayed on the views edit page instead of the default one. This might be useful if you have the same item twice.'),
+      '#title' => $this->t('Administrative title'),
+      '#description' => $this->t('This title will be displayed on the views edit page instead of the default one. This might be useful if you have the same item twice.'),
       '#default_value' => $this->options['admin_label'],
       '#parents' => array('options', 'admin_label'),
     );
@@ -314,7 +330,30 @@ public function buildOptionsForm(&$form, &$form_state) {
     );
     // Allow to alter the default values brought into the form.
     // @todo Do we really want to keep this hook.
-    \Drupal::moduleHandler()->alter('views_handler_options', $this->options, $this->view);
+    $this->getModuleHandler()->alter('views_handler_options', $this->options, $this->view);
+  }
+
+  /**
+   * Gets the module handler.
+   *
+   * @return \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected function getModuleHandler() {
+    if (!$this->moduleHandler) {
+      $this->moduleHandler = \Drupal::moduleHandler();
+    }
+
+    return $this->moduleHandler;
+  }
+
+  /**
+   * Sets the module handler.
+   *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler.
+   */
+  public function setModuleHandler(ModuleHandlerInterface $module_handler) {
+    $this->moduleHandler = $module_handler;
   }
 
   /**
@@ -341,9 +380,9 @@ public function buildGroupByForm(&$form, &$form_state) {
 
     $form['group_type'] = array(
       '#type' => 'select',
-      '#title' => t('Aggregation type'),
+      '#title' => $this->t('Aggregation type'),
       '#default_value' => $this->options['group_type'],
-      '#description' => t('Select the aggregation function to use on this field.'),
+      '#description' => $this->t('Select the aggregation function to use on this field.'),
       '#options' => $group_types,
     );
   }
@@ -655,6 +694,29 @@ public function getDateField() {
   }
 
   /**
+   * Gets views data service.
+   *
+   * @return \Drupal\views\ViewsData
+   */
+  protected function getViewsData() {
+    if (!$this->viewsData) {
+      $this->viewsData = Views::viewsData();
+    }
+
+    return $this->viewsData;
+  }
+
+  /**
+   * Sets the views data service.
+   *
+   * @param \Drupal\views\ViewsData $views_data
+   *   The views data.
+   */
+  public function setViewsData(ViewsData $views_data) {
+    $this->viewsData = $views_data;
+  }
+
+  /**
    * Fetches a handler to join one table to a primary table from the data cache.
    *
    * @param string $table
@@ -710,10 +772,10 @@ public function getEntityType() {
     // If the user has configured a relationship on the handler take that into
     // account.
     if (!empty($this->options['relationship']) && $this->options['relationship'] != 'none') {
-      $views_data = Views::viewsData()->get($this->view->relationship->table);
+      $views_data = $this->getViewsData()->get($this->view->relationship->table);
     }
     else {
-      $views_data = Views::viewsData()->get($this->view->storage->get('base_table'));
+      $views_data = $this->getViewsData()->get($this->view->storage->get('base_table'));
     }
 
     if (isset($views_data['table']['entity type'])) {
