diff --git a/nodejs.module b/nodejs.module
index 86b27d5f7294d7078a412bf0ebb8ebc19972a97d..e1c9f6534a20a5c334d974cdf399112170a1d020 100644
--- a/nodejs.module
+++ b/nodejs.module
@@ -1,14 +1,18 @@
 <?php
 
 use Drupal\Component\Utility\Crypt;
-use Guzzle\Http\Exception\BadResponseException;
-use Guzzle\Http\Exception\RequestException;
+use Drupal\Core\Url;
+use GuzzleHttp\Exception\BadResponseException;
+use GuzzleHttp\Exception\RequestException;
+use Drupal\Component\Serialization\Json;
+use Drupal\Core\Site\Settings;
+use Drupal\Core\Session\AnonymousUserSession;
 
 /**
  * Generate a token for a piece of content.
  */
 function nodejs_generate_content_token() {
-  return Crypt::hmacBase64(uniqid(mt_rand(), TRUE), \Drupal::service('private_key')->get() . drupal_get_hash_salt());
+  return Crypt::hmacBase64(uniqid(mt_rand(), TRUE), \Drupal::service('private_key')->get() . $hash_salt = Settings::getHashSalt());
 }
 
 /**
@@ -51,7 +55,7 @@ function nodejs_send_content_channel_token($channel, $notify_on_disconnect = FAL
       return $node_response;
     }
     else {
-      watchdog('nodejs', t('Error sending content channel token for channel "%channel". Node.js server response: %error', array('%channel' => $channel, '%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error(t('Error sending content channel token for channel "%channel". Node.js server response: %error', array('%channel' => $channel, '%error' => $node_response->error)));
       return FALSE;
     }
   }
@@ -72,7 +76,7 @@ function nodejs_get_content_channel_users($channel) {
   // Http request went ok, process Node.js server response.
   if ($node_response = Nodejs::getContentTokenUsers($message)) {
     if (isset($node_response->error)) {
-      watchdog('nodejs', t('Error getting content channel users for channel "%channel" on the Node.js server. Server response: %error', array('%channel' => $channel, '%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error(t('Error getting content channel users for channel "%channel" on the Node.js server. Server response: %error', array('%channel' => $channel, '%error' => $node_response->error)));
       return FALSE;
     }
     else {
@@ -102,7 +106,8 @@ function nodejs_kick_user($uid) {
       return TRUE;
     }
     else {
-      watchdog('nodejs', t('Error kicking uid "%uid" from the Node.js server. Server response: %error', array('%uid' => $uid, '%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error kicking uid "%uid" from the Node.js server. Server response: %error', array('%uid' => $uid, '%error' => $node_response->error)));
+
       return FALSE;
     }
   }
@@ -126,7 +131,7 @@ function nodejs_logout_user($token) {
       return TRUE;
     }
     else {
-      watchdog('nodejs', t('Error logging out token "%token" from the Node.js server. Server response: %error', array('%token' => $token, '%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error logging out token "%token" from the Node.js server. Server response: %error', array('%token' => $token, '%error' => $node_response->error)));
       return FALSE;
     }
   }
@@ -149,7 +154,7 @@ function nodejs_set_user_presence_list($uid, array $uids) {
       return TRUE;
     }
     else {
-      watchdog('nodejs', t('Error setting user presence list for uid "%uid" on the Node.js server. Server response: %error', array('%uid' => $uid, '%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error setting user presence list for uid "%uid" on the Node.js server. Server response: %error', array('%uid' => $uid, '%error' => $node_response->error)));
       return FALSE;
     }
   }
@@ -253,9 +258,10 @@ function nodejs_send_role_message($role_name, $subject, $body) {
  */
 function nodejs_add_js_to_page_check() {
   $account = \Drupal::currentUser();
-  $path = \Drupal::service('path.alias_manager')->getAliasByPath(current_path());
+  $path = \Drupal::service('path.alias_manager')->getAliasByPath(Url::fromRoute('<current>')->toString());
   $cinfig_paths = \Drupal::config('nodejs.config')->get('nodejs_pages');
-  $valid_page = drupal_match_path($path, $cinfig_paths);
+  $valid_page = \Drupal::service('path.matcher')->matchPath($path, $cinfig_paths) ;
+
   if (\Drupal::config('nodejs.config')->get('nodejs_authenticated_users_only')) {
     $valid_user = $account->id() > 0;
   }
@@ -284,8 +290,8 @@ function nodejs_get_socketio_js_config($nodejs_config) {
  * Get a list of javascript handler files.
  */
 function nodejs_get_js_handlers() {
-  $handlers = module_invoke_all('nodejs_handlers_info');
-  drupal_alter('nodejs_js_handlers', $handlers);
+  $handlers = \Drupal::moduleHandler()->invokeAll('nodejs_handlers_info', $args = array());
+  \Drupal::moduleHandler()->alter('nodejs_js_handlers', $handlers);
   return $handlers;
 }
 
@@ -349,7 +355,7 @@ function nodejs_get_add_channel($channel) {
       return TRUE;
     }
     else {
-      watchdog('nodejs', t('Error adding channel to the Node.js server. Server response: %error', array('%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error adding channel to the Node.js server. Server response: %error', array('%error' => $node_response->error)));
       return FALSE;
     }
   }
@@ -373,7 +379,7 @@ function nodejs_get_check_channel($channel) {
       return $node_response->result;
     }
     else {
-      watchdog('nodejs', t('Error checking channel on the Node.js server. Server response: %error', array('%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error checking channel on the Node.js server. Server response: %error', array('%error' => $node_response->error)));
       return FALSE;
     }
   }
@@ -396,7 +402,7 @@ function nodejs_get_remove_channel($channel) {
       return TRUE;
     }
     else {
-      watchdog('nodejs', t('Error removing channel from the Node.js server. Server response: %error', array('%error' => $node_response->error)));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error removing channel from the Node.js server. Server response: %error', array('%error' => $node_response->error)));
       return FALSE;
     }
   }
@@ -461,7 +467,7 @@ function nodejs_auth_check($message) {
     throw new Exception("No nodejs_auth_check callback found - looked for '$nodejs_auth_check_callback'.");
   }
   $uid = $nodejs_auth_check_callback($message['authToken']);
-  $account = $uid > 0 ? user_load($uid) : drupal_anonymous_user();
+  $account = $uid > 0 ? user_load($uid) : new AnonymousUserSession();
   $auth_user = new stdClass();
   $auth_user->uid = $account->id();
   $auth_user->authToken = $message['authToken'];
@@ -471,7 +477,7 @@ function nodejs_auth_check($message) {
   if ($auth_user->nodejsValidAuthToken) {
     // Get the list of channels I have access to.
     $auth_user->channels = array();
-    foreach (module_implements('nodejs_user_channels') as $module) {
+    foreach (\Drupal::moduleHandler()->getImplementations('nodejs_user_channels') as $module) {
       $function = $module . '_nodejs_user_channels';
       foreach ($function($auth_user) as $channel) {
         $auth_user->channels[] = $channel;
@@ -479,12 +485,13 @@ function nodejs_auth_check($message) {
     }
 
     // Get the list of users who can see presence notifications about me.
-    $auth_user->presenceUids = array_unique(module_invoke_all('nodejs_user_presence_list', $auth_user));
+    $auth_user->presenceUids = array_unique(\Drupal::moduleHandler()->invokeAll('nodejs_user_presence_list', $auth_user));
 
     $nodejs_config = nodejs_get_config();
     $auth_user->serviceKey = $nodejs_config['serviceKey'];
+    // TODO: change me: https://www.drupal.org/node/2549159
     drupal_add_http_header('NodejsServiceKey', $nodejs_config['serviceKey']);
-    drupal_alter('nodejs_auth_user', $auth_user);
+    \Drupal::moduleHandler()->alter('nodejs_auth_user', $auth_user);
     if ($auth_user->uid) {
       nodejs_user_set_online($auth_user->uid);
     }
@@ -515,8 +522,7 @@ function nodejs_auth_get_token($account) {
  * Default nodejs_auth_get_token() implementation.
  */
 function nodejs_auth_get_token_callback($account) {
-  drupal_session_start();
-  return md5($account->getSessionId());
+  return md5(\Drupal::request()->getSession());
 }
 
 /**
@@ -605,7 +611,7 @@ function nodejs_remove_user_from_channel($uid, $channel) {
         '%channel' => $channel,
         '%error' => $node_response->error,
       );
-      watchdog('nodejs', t('Error removing user with uid: %uid from channel %channel on the Node.js server. Server response: %error', $params));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error removing user with uid: %uid from channel %channel on the Node.js server. Server response: %error', $params));
       return FALSE;
     }
   }
@@ -634,7 +640,7 @@ function nodejs_add_user_to_channel($uid, $channel) {
         '%channel' => $channel,
         '%error' => $node_response->error,
       );
-      watchdog('nodejs', t('Error adding user with uid: %uid to channel %channel on the Node.js server. Server response: %error', $params));
+      \Drupal::logger('nodejs')->error('nodejs', t('Error adding user with uid: %uid to channel %channel on the Node.js server. Server response: %error', $params));
       return FALSE;
     }
   }
@@ -685,11 +691,12 @@ class Nodejs {
 
   public static function sendMessage(StdClass $message) {
     self::initConfig();
-    drupal_alter('nodejs_message', $message);
+    \Drupal::moduleHandler()->alter('nodejs_message', $message);
+
     $message->clientSocketId = nodejs_get_client_socket_id();
     $options = array(
       'method' => 'POST',
-      'data' => drupal_json_encode($message),
+      'data' => Json::encode($message),
       'headers' => self::$headers,
       // This is server to server, so start with a low default timeout.
       'timeout' => !empty(self::$config['timeout']) ? self::$config['timeout'] : 5,
@@ -710,10 +717,11 @@ class Nodejs {
   public static function sendContentTokenMessage($message) {
     self::initConfig();
     $message->clientSocketId = nodejs_get_client_socket_id();
-    drupal_alter('nodejs_content_channel_message', $message);
+    \Drupal::moduleHandler()->alter('nodejs_content_channel_message', $message);
+
     $options = array(
       'method' => 'POST',
-      'data' => drupal_json_encode($message),
+      'data' => Json::encode($message),
       'headers' => self::$headers,
       'options' => array('timeout' => 5.0),
     );
@@ -724,7 +732,7 @@ class Nodejs {
     self::initConfig();
     $options = array(
       'method' => 'POST',
-      'data' => drupal_json_encode($message),
+      'data' => Json::encode($message),
       'headers' => self::$headers,
     );
     return self::httpRequest('nodejs/content/token', $options);
@@ -734,7 +742,7 @@ class Nodejs {
     self::initConfig();
     $options = array(
       'method' => 'POST',
-      'data' => drupal_json_encode($message),
+      'data' => Json::encode($message),
       'headers' => self::$headers,
     );
     return self::httpRequest('nodejs/content/token/users', $options);
@@ -772,7 +780,7 @@ class Nodejs {
 
   public static function httpRequest($url, $options) {
     self::initConfig();
-
+    // Changed later in drupal8, TODO changeme.
     $request = \Drupal::service('http_default_client')
       ->createRequest($options['method'], self::$baseUrl . $url, $options['headers'], $options['data']);
 
@@ -781,15 +789,15 @@ class Nodejs {
       if ($response->getStatusCode() != 200) {
         return FALSE;
       }
-    
+
       return json_decode($response->getBody(TRUE));
     }
     catch (BadResponseException $e) {
-      watchdog('nodejs', 'Error reaching the Node.js server- BadResponseException');
+      \Drupal::logger('nodejs')->error('nodejs', 'Error reaching the Node.js server- BadResponseException');
       return FALSE;
     }
     catch (RequestException $e) {
-      watchdog('nodejs', 'Error reaching the Node.js server - RequestException');
+      \Drupal::logger('nodejs')->error('nodejs', 'Error reaching the Node.js server - RequestException');
       return FALSE;
     }
     return FALSE;
diff --git a/nodejs_actions/nodejs_actions.module b/nodejs_actions/nodejs_actions.module
index 358154fb5ba476da490b23be3b9ab10d96f949b4..287db6750bcb7da994906c68c7e3aef74497dd21 100644
--- a/nodejs_actions/nodejs_actions.module
+++ b/nodejs_actions/nodejs_actions.module
@@ -7,7 +7,7 @@ function nodejs_actions_action_info() {
   $actions = array();
 
   $triggers = module_invoke_all('trigger_info');
-  drupal_alter('trigger_info', $triggers);
+  \Drupal::moduleHandler()->alter('trigger_info', $triggers);
 
   foreach (array('node', 'user', 'comment') as $type) {
     $actions['nodejs_actions_' . $type . '_action'] = array(
diff --git a/nodejs_ajax/src/EventSubscriber/NodejsAjaxSubscriber.php b/nodejs_ajax/src/EventSubscriber/NodejsAjaxSubscriber.php
index 8a0a007080d29d3fd224c8e6a84f149fb4c7e2bd..52d928ba766b3c1f604a800f037f2dd607a2f20d 100644
--- a/nodejs_ajax/src/EventSubscriber/NodejsAjaxSubscriber.php
+++ b/nodejs_ajax/src/EventSubscriber/NodejsAjaxSubscriber.php
@@ -16,7 +16,7 @@ class NodejsAjaxSubscriber implements EventSubscriberInterface {
 
   public function initLibraries(GetResponseEvent $event) {
     $attached['#attached']['library'][] = 'core/drupal.ajax';
-    drupal_render($attached);
+    //drupal_render($attached);
   }
 
   /**
diff --git a/nodejs_config/src/Form/NodejsConfigSettingsForm.php b/nodejs_config/src/Form/NodejsConfigSettingsForm.php
index f70076f0098fcf7f75e381c5ea672c1622221757..d2a2fba4585ad9cf5f4e73f1b292409cee55e51c 100644
--- a/nodejs_config/src/Form/NodejsConfigSettingsForm.php
+++ b/nodejs_config/src/Form/NodejsConfigSettingsForm.php
@@ -195,7 +195,7 @@ class NodejsConfigSettingsForm extends ConfigFormBase {
       'jsEtag' => true,
       'logLevel' => 1
     );
-    $output = 'backendSettings = ' . drupal_json_encode($array);
+    $output = 'backendSettings = ' . Json::encode($array);
     $output = str_replace(array('= {', ',', '}}', ':{', '\/'), array("= {\n  ", ",\n  ", "\n  }\n}", ":{\n  ",  '/'), $output);
     $output = "/**\n* This configuration file was built using the 'Node.js server configuration builder'.\n* For a more fully commented example see the file nodejs.config.js.example in the root of this module\n*/\n" . $output . ';';
 
diff --git a/nodejs_subscribe/nodejs_subscribe.module b/nodejs_subscribe/nodejs_subscribe.module
index cc12993b159e3cbb6e49e870d7db0b2ea2fbd075..e9c2dce748ac1caac383804957defdfafdff605e 100644
--- a/nodejs_subscribe/nodejs_subscribe.module
+++ b/nodejs_subscribe/nodejs_subscribe.module
@@ -179,7 +179,7 @@ function nodejs_subscribe_node_update($node) {
       }
       catch (Exception $e) {
         $transaction->rollback();
-        watchdog('nodejs_subscribe', t('Error processing node subscription for nid %nid', array(':nid' => $node->nid)));
+        \Drupal::logger('nodejs')->error('nodejs_subscribe', t('Error processing node subscription for nid %nid', array(':nid' => $node->nid)));
       }
     }
     else {
diff --git a/nodejs_watchdog/nodejs_watchdog.module b/nodejs_watchdog/nodejs_watchdog.module
index 1463262ccca90b548408115a21caed96b840166d..711576eb73754de9af92cf3488ba4ff0c97b4f88 100644
--- a/nodejs_watchdog/nodejs_watchdog.module
+++ b/nodejs_watchdog/nodejs_watchdog.module
@@ -10,6 +10,7 @@ function nodejs_watchdog_form_dblog_filter_form_alter(&$form, &$form_state, $for
 
 /**
  * Implements hook_watchdog().
+ * TODO: re-write, SEE https://www.drupal.org/node/2270941
  */
 function nodejs_watchdog_watchdog(array $entry) {
   $classes = array(
diff --git a/src/EventSubscriber/NodejsSubscriber.php b/src/EventSubscriber/NodejsSubscriber.php
index ad28348555fd905836e26039ce2acca6d81dcc9f..b76ab15fa6c20f416574764eb98c675574a95e4c 100644
--- a/src/EventSubscriber/NodejsSubscriber.php
+++ b/src/EventSubscriber/NodejsSubscriber.php
@@ -18,9 +18,9 @@ class NodejsSubscriber implements EventSubscriberInterface {
     drupal_register_shutdown_function(array('Nodejs', 'sendMessages'));
     if (nodejs_add_js_to_page_check()) {
       $attached['#attached']['library'][] = 'nodejs/init';
-      drupal_render($attached);
+      //drupal_render($attached);
     }
-    
+
   }
 
   /**
diff --git a/src/NodejsPages.php b/src/NodejsPages.php
index 86da05c47c7bcf888c3cc3524f614b261b067621..309d909b618b917dddc6b599184d4cbdd98a87e4 100644
--- a/src/NodejsPages.php
+++ b/src/NodejsPages.php
@@ -13,7 +13,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
  * Returns responses for Node.js routes.
  */
 class NodejsPages{
-  
+
 
   /**
    * @todo .
@@ -22,22 +22,22 @@ class NodejsPages{
     if (!isset($_POST['serviceKey']) || !nodejs_is_valid_service_key($_POST['serviceKey'])) {
       return new JsonResponse(array('error' => 'Invalid service key.'));
     }
-  
+
     if (!isset($_POST['messageJson'])) {
       return new JsonResponse(array('error' => 'No message.'));
     }
-  
+
     $message = drupal_json_decode($_POST['messageJson']);
     $response = array();
     switch ($message['messageType']) {
       case 'authenticate':
         $response = nodejs_auth_check($message);
         break;
-  
+
       case 'userOffline':
         nodejs_user_set_offline($message['uid']);
         break;
-  
+
       default:
         $handlers = array();
         foreach (module_implements('nodejs_message_callback') as $module) {
@@ -48,8 +48,8 @@ class NodejsPages{
           $callback($message, $response);
         }
     }
-    drupal_alter('nodejs_message_response', $response, $message);
-  
+    \Drupal::moduleHandler()->alter('nodejs_message_response', $response, $message);
+
     return new JsonResponse($response ? $response : array('error' => 'Not implemented'));
   }
 
