diff --git a/advagg.services.yml b/advagg.services.yml
index 8e19a5c..c0299a5 100644
--- a/advagg.services.yml
+++ b/advagg.services.yml
@@ -42,7 +42,7 @@ services:
     arguments: [advagg_minify]
   state.advagg.aggregates:
     class: Drupal\advagg\State\Aggregates
-    arguments: ['@keyvalue']
+    arguments: ['@keyvalue', '@cache.bootstrap', '@lock']
   state.advagg.files:
     class: Drupal\advagg\State\Files
-    arguments: ['@keyvalue', '@config.factory', '@module_handler', '@asset.css.dumper' ]
+    arguments: ['@keyvalue', '@config.factory', '@module_handler', '@asset.css.dumper', '@cache.bootstrap', '@lock']
diff --git a/src/State/Aggregates.php b/src/State/Aggregates.php
index 09d4b99..1f8608a 100644
--- a/src/State/Aggregates.php
+++ b/src/State/Aggregates.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\advagg\State;
 
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
+use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Core\State\StateInterface;
 
 /**
@@ -16,7 +18,8 @@ class Aggregates extends State implements StateInterface {
    * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
    *   The key value store to use.
    */
-  public function __construct(KeyValueFactoryInterface $key_value_factory) {
+  public function __construct(KeyValueFactoryInterface $key_value_factory, CacheBackendInterface $cache, LockBackendInterface $lock) {
+    parent::__construct($key_value_factory, $cache, $lock);
     $this->keyValueStore = $key_value_factory->get('advagg_aggregates');
     $this->pathColumn = 'uri';
   }
diff --git a/src/State/Files.php b/src/State/Files.php
index 0d6cf25..89eaf28 100644
--- a/src/State/Files.php
+++ b/src/State/Files.php
@@ -3,16 +3,18 @@
 namespace Drupal\advagg\State;
 
 use Drupal\Core\Asset\AssetDumperInterface;
+use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
-use Drupal\Core\State\StateInterface;
+use Drupal\Core\Lock\LockBackendInterface;
+use Drupal\Core\Site\Settings;
 use Drupal\Component\Utility\Crypt;
 
 /**
  * Provides AdvAgg with a file status state system using a key value store.
  */
-class Files extends State implements StateInterface {
+class Files extends State {
 
   /**
    * A config object for the advagg configuration.
@@ -53,8 +55,13 @@ class Files extends State implements StateInterface {
    *   The module handler.
    * @param \Drupal\Core\Asset\AssetDumperInterface $asset_dumper
    *   The dumper for optimized CSS assets.
+   * @param \Drupal\Core\Cache\CacheBackendInterface $cache
+   *   The cache backend.
+   * @param \Drupal\Core\Lock\LockBackendInterface $lock
+   *   The lock backend.
    */
-  public function __construct(KeyValueFactoryInterface $key_value_factory, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, AssetDumperInterface $asset_dumper) {
+  public function __construct(KeyValueFactoryInterface $key_value_factory, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, AssetDumperInterface $asset_dumper, CacheBackendInterface $cache, LockBackendInterface $lock) {
+    parent::__construct($key_value_factory, $cache, $lock);
     $this->keyValueStore = $key_value_factory->get('advagg_files');
     $this->config = $config_factory->get('advagg.settings');
     $this->moduleHandler = $module_handler;
@@ -137,7 +144,6 @@ class Files extends State implements StateInterface {
     $this->moduleHandler->alter('advagg_scan_file', $file, $data, $cached);
     unset($data['contents']);
     $this->set($file, $data);
-    $this->cache[$file] = $data;
     return $data;
   }
 
@@ -152,11 +158,11 @@ class Files extends State implements StateInterface {
 
     foreach ($keys as $key) {
       // Check if we have a value in the cache.
-      if (isset($this->cache[$key])) {
-        $values[$key] = $this->cache[$key];
+      $value = $this->get($key);
+      if ($value) {
+        $values[$key] = $value;
       }
-      // Load the value if we don't have an explicit NULL value.
-      elseif (!array_key_exists($key, $this->cache)) {
+      else {
         $load[] = $key;
       }
     }
@@ -168,7 +174,7 @@ class Files extends State implements StateInterface {
         if (isset($loaded_values[$key])) {
           if ($refresh_data === FALSE) {
             $values[$key] = $loaded_values[$key];
-            $this->cache[$key] = $loaded_values[$key];
+            $this->set($key, $loaded_values[$key]);
             continue;
           }
           $file_contents = (string) @file_get_contents($key);
@@ -178,7 +184,6 @@ class Files extends State implements StateInterface {
             if (!file_exists($key)) {
               $this->delete($key);
               $values[$key] = NULL;
-              $this->cache[$key] = NULL;
               continue;
             }
             // If cache is Normal, check file for changes.
@@ -186,7 +191,7 @@ class Files extends State implements StateInterface {
               $content_hash = Crypt::hashBase64($file_contents);
               if ($content_hash == $loaded_values[$key]['content_hash']) {
                 $values[$key] = $loaded_values[$key];
-                $this->cache[$key] = $loaded_values[$key];
+                $this->set($key, $loaded_values[$key]);
                 continue;
               }
             }
@@ -208,6 +213,19 @@ class Files extends State implements StateInterface {
   }
 
   /**
+   * {@inheritdoc}
+   */
+  public function get($key, $default = NULL) {
+    if (version_compare(\Drupal::VERSION, '8.3.0') >= 0) {
+      return parent::get($key, $default);
+    }
+    else {
+      $values = parent::getMultiple(array($key));
+    }
+    return isset($values[$key]) ? $values[$key] : $default;
+  }
+
+  /**
    * Split up a CSS string by @media queries.
    *
    * @param string $css
diff --git a/src/State/State.php b/src/State/State.php
index cf4e392..910e28c 100644
--- a/src/State/State.php
+++ b/src/State/State.php
@@ -3,17 +3,16 @@
 namespace Drupal\advagg\State;
 
 use Drupal\Core\State\State as CoreState;
-use Drupal\Core\State\StateInterface;
 
 /**
  * Provides AdvAgg State interfaces with a few extra commands.
  */
-abstract class State extends CoreState implements StateInterface {
+abstract class State extends CoreState {
 
   /**
    * If the array isn't keyed by filepath the column the filepath is stored in.
    */
-  private $pathColumn = NULL;
+  protected $pathColumn = NULL;
 
   /**
    * Gets all stored information from this Key Value Store.
@@ -23,7 +22,6 @@ abstract class State extends CoreState implements StateInterface {
    */
   public function getAll() {
     $values = $this->keyValueStore->getAll();
-    $this->cache += $values;
     return $values;
   }
 
@@ -38,10 +36,7 @@ abstract class State extends CoreState implements StateInterface {
    * Get a semi-random (randomness not guaranteed) key.
    */
   public function getRandomKey() {
-    if (empty($this->cache)) {
-      $this->getAll();
-    }
-    $key = array_rand($this->cache);
+    $key = array_rand($this->getAll());
     return $key;
   }
 
