diff --git a/rpx_widgets.module b/rpx_widgets.module
index 2bc89ef..490bb52 100755
--- a/rpx_widgets.module
+++ b/rpx_widgets.module
@@ -69,13 +69,15 @@ function _rpx_user_login_form_alter(&$form, &$form_state) {
     ),
   );
 
+  $sign_in_string = variable_get('rpx_signin_string', RPX_SIGNIN_STRING);
+  if ($sign_in_string) {
+    $items[] = l(t($sign_in_string), $sign_in_url, $options);
+  }
+
   $icons = '';
   foreach ($providers as $provider_name => $provider_title) {
-    $icons .= theme('rpx_icon', array('provider' => $provider_name, 'size' => variable_get('rpx_login_icons_size', 'small')));
+    $items[] = theme('rpx_icon', array('provider' => $provider_name, 'size' => variable_get('rpx_login_icons_size', 'small')));
   }
-  $items[] = array(
-    'data' => l((variable_get('rpx_signin_string', RPX_SIGNIN_STRING) == '') ? RPX_SIGNIN_STRING : variable_get('rpx_signin_string', RPX_SIGNIN_STRING). '<br />' . $icons, $sign_in_url, $options),
-  );
 
   $form['rpx_links'] = array(
     '#theme' => 'item_list',
@@ -96,7 +98,6 @@ function _rpx_user_login_form_alter(&$form, &$form_state) {
  * @see rpx_widgets_comment_insert()
  */
 function rpx_widgets_comment_view_alter(&$build) {
-
   global $user;
   $comment = $build['#comment'];
   $node = node_load($comment->nid);
@@ -113,7 +114,6 @@ function rpx_widgets_comment_view_alter(&$build) {
   if (!$attach_share && !$popup_social) {
     return;
   }
-  $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . request_uri() . '#comment-' . $comment->cid;
 
   // Prepare arguments for Social Sharing
   $args = array();
@@ -124,54 +124,22 @@ function rpx_widgets_comment_view_alter(&$build) {
     $args[$arg] = filter_xss(token_replace($args[$arg], array('node' => $node, 'user' => $user, 'comment' => $comment), array('clear' => TRUE, 'sanitize' => FALSE)));
   }
 
-  $summary = addslashes(text_summary(strip_tags($args['summary']), NULL, 150) . '...');
-  
-  // Sharing cookie info (used in Rules integration).
-  if (module_exists('rpx_rules') && _rpx_event_enabled('rpx_social_cookie_set_comment')) {
-    // Sharing cookie info (used in Rules integration).
-    // Pass node sharing info to social JS.
-    //
-    $settings = array();
-    $settings['rpx']['rpx-link-social-comment-'. $comment->cid]['post'] = array(
-      'label' => $args['label'],
-      'link' => $url,
-      'comment' => $args['message'],
-      'summary' => $summary,
-      'title' => $args['title'],
-    );
-  
-    // For some reason this plugin is not added for Chrome (and maybe others).
-    drupal_add_library('system', 'jquery.cookie');
+  $args['summary'] = addslashes(text_summary(strip_tags($args['summary']), NULL, 150) . '...');
+  $args['url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . request_uri() . '#comment-' . $comment->cid; 
+  $args['entity_type'] = 'comment';
+  $args['entity_id'] = $comment->cid;
+  // Since this is going into the links, hide the icons.
+  $args['icons'] = null;
 
-    // Instruct social JS to set a cookie and trigger a page reload so that an
-    // Engage social sharing Rules event can be fired.
-    $settings['rpx']['rpx-link-social-comment-'.$comment->cid]['cookie'] = array(
-      'type' => 'comment',
-      'id' => $comment->cid,
-    );
-    drupal_add_js($settings, 'setting');
-  }
-  
-  
-  // Attach a "share" link to this comment.
-  $attributes = array(
-    'class' => array('rpx-link-social'),
-    'id' => 'rpx-link-social-comment-'. $comment->cid,
-    'onclick' => "setShare('$url','{$args['title']}','{$args['message']}','$summary','facebook'); return false;",
-  );
   $build['links']['comment']['#links']['comment-rpx-share'] = array(
-    'title' => t('share'),
-    'href' => $url,
-    'attributes' => $attributes,
+    'title' => theme('rpx_share_button', array('args'=> $args, 'text' => $args['label'])),
+    'html' => TRUE,
   );
-  
-  // output the js
-  rpx_js_social();
-  
+
   // Pass arguments for the social widget that will be invoked for this
   // comment immediately upon page reload.
   if ($popup_social) {
-    $output = "setTimeout(function(){setShare('$url','{$args['message']}','{$args['title']}','$summary','facebook')},300);";
+    $output = "setTimeout(function(){setShare('{$args['url']}','{$args['message']}','{$args['title']}','{$args['summary']}','facebook')},300);";
     drupal_add_js($output, array('type' => 'inline', 'scope' => 'footer'));
   }
 }
@@ -319,30 +287,23 @@ function _rpx_ssl() {
  *
  * An image sprite with all Engage provider icons is included in the images
  * directory for custom theming purposes.
- */
+ **/
 function theme_rpx_icon($variables) {
   $provider = $variables['provider'];
-  
-  if (isset($variables['node'])) {$nid = $variables['node']->nid;}
-  else {$nid = rand(1,1000);}
   $size = $variables['size'] == 'small' ? '16' : '32';
-  $style = array(
-    'janrain-provider-icon-' . $size,
-    'janrain-provider-icon-' . $provider,
-    'rpx-link-social',
-  );
-  if ($variables['style']) {
-    $style[] = $variables['style'];
-  }
-  if (isset($variables['args'])){
-      $args = $variables['args'];
-    
-      return '<span' . drupal_attributes(array('class' => $style, 'id' => 'rpx-link-social-node-' . $nid, 'rel' => $provider, 'onclick' => "setShare('{$args['url']}','{$args['title']}','{$args['message']}','{$args['summary']}',this.getAttribute('rel')); return false;",)) . '></span>';
-  }
-  else {
+  $args = $variables['args'];
+  $attributes = $variables['attributes'];
 
-  return '<div' . drupal_attributes(array('class' => $style, 'id' => 'rpx-link-social-node-' . $nid)) . '></div>';
+  $attributes['class'][] = 'janrain-provider-icon-' . $size;
+  $attributes['class'][] = 'janrain-provider-icon-' . $provider;
+  $attributes['class'][] = 'rpx-link-social';
+  $attributes['rel'] = $provider;
+
+  if (!empty($args)) {
+    $attributes['onclick'] = "setShare('{$args['url']}','{$args['title']}','{$args['message']}','{$args['summary']}',this.getAttribute('rel')); return false;";
   }
+
+  return '<span' . drupal_attributes($attributes) . '></span>';
 }
 
 /**
@@ -350,32 +311,101 @@ function theme_rpx_icon($variables) {
  */
 function theme_rpx_social_icons($variables) {
   $args = $variables['args'];
-  $node = $variables['node'];
-  
-  $icons = '';
-  $providers = explode(',', variable_get('rpx_social_pub'));
+  $providers = $variables['providers'];
+
+  if (empty($providers)) {
+    $providers = variable_get('rm 17  ');
+    if ($providers == "") {
+      // No providers are listed, do not return blank span.
+      return;
+    }
+    $providers = explode(',', $providers);
+  }
+  $output = '';
+
   foreach ($providers as $provider) {
-    $icons .= theme('rpx_icon', array('args'=> $args, 'provider' => $provider, 'size' => 'small', 'node'=> $node));
+    $output .= theme('rpx_icon', array('args'=> $args, 'provider' => $provider, 'size' => 'small'));
   }
-  return $icons;
+  return $output;
 }
 
 /**
  * Returns markup for the "share" button.
- */
+ **/
 function theme_rpx_share_button($variables) {
-  $node = $variables['node'];
+  $text = $variables['text'];
+  $attributes = $variables['attributes'];
+  $icons = $variables['icons'];
   $args = $variables['args'];
-  
-  $button_style = array(
-    'janrain-share-container',
+  // Ensure defaults are set for $args.
+  $args += array(
+    'label' => '',
+    'link' => '',
+    'message' => '',
+    'summary' => '',
+    'title' => '',
+    'provider' => 'facebook',
   );
-  $text = isset($args['text']) ? $args['text'] : 'Share on';
-  $attributes = array(
-  'class' => $button_style,
-  'id' => 'rpx-link-social-node-'. $node->nid,
+
+  if (isset($args['entity_type']) && isset($args['entity_id'])) {
+    $id = 'rpx-link-social-' . $args['entity_type'] . '-' . $args['entity_id'];
+    $rpx_event_enabled = (module_exists('rpx_rules') && _rpx_event_enabled('rpx_social_cookie_set_' . $args['entity_type'])) ? TRUE : FALSE;
+  }
+  else {
+    // Grab a unique id for each link on a page.
+    static $linkid = 0;
+    $linkid++;
+    $id = 'rpx-link-social-link-' . $linkid;
+    // As this isnt connected to an entity, disable automatically.
+    $rpx_event_enabled = FALSE;
+  }
+
+  // Allow text to also be a renderable array.
+  if (is_array($variables['text'])) {
+    $text = drupal_render($variables['text']);
+  }
+
+  // Add in attributes we need to be set.
+  $attributes['onclick'] = "setShare('{$args['url']}','{$args['title']}','{$args['message']}','{$args['summary']}',this.getAttribute('rel')); return false;";
+  $attributes['class'][] = 'janrain-share-text';
+  $attributes['class'][] = 'rpx-link-social';
+  $attributes['rel'] = $args['provider'];
+
+  // Ensure the proper javascript is attached.
+  $settings = array();
+  // Arguments for RPXNOW.Social.Activity().
+  $settings['rpx'][$id]['post'] = array(
+    'label' => $args['label'],
+    'link' => $args['url'],
+    'comment' => $args['message'],
+    'summary' => $args['summary'],
+    'title' => $args['title'],
   );
-  return '<div' . drupal_attributes($attributes) . '><span class="janrain-share-text">'.$text.'</span>'. theme('rpx_social_icons', array('args'=> $args, 'node'=> $node)) .'</div>';}
+
+  // Sharing cookie info (used in Rules integration).
+  if ($rpx_event_enabled) {
+    // For some reason this plugin is not added for Chrome (and maybe others).
+    drupal_add_library('system', 'jquery.cookie');
+
+    // Instruct social JS to set a cookie and trigger a page reload so that an
+    // Engage social sharing Rules event can be fired.
+    $settings['rpx'][$id]['cookie'] = array(
+      'type' => $args['entity_type'],
+      'id' => $args['entity_id'],
+    );
+  }
+
+  drupal_add_js($settings, 'setting');
+  rpx_js_social();
+
+  // If $icons has been set to null, return without icons, otherwise theme them.
+  if ($icons = null) {
+    return '<div class="janrain-share-container"><div ' . drupal_attributes($attributes) . '>' . $text . '</div></div>';
+  }
+  else {
+    return '<div class="janrain-share-container"><div ' . drupal_attributes($attributes) . '>' . $text . '</div>' . theme('rpx_social_icons', array('providers' => $icons, 'args' => $args)) . '</div>';
+  }
+}
 
 /**
  * Implements hook_theme().
@@ -383,10 +413,33 @@ function theme_rpx_share_button($variables) {
 function rpx_widgets_theme() {
   return array(
     'rpx_icon' => array(
-      'variables' => array('provider' => NULL, 'size' => 'small', 'style' => NULL),
+      'variables' => array(
+        'provider' => NULL,
+        'size' => 'small',
+        'attributes' => array(),
+        'args' => array(),
+      ),
+    ),
+    'rpx_share_button' => array(
+      'variables' => array(
+        'text' => t('Share on '),
+        'attributes' => array(),
+        'icons' => array(),
+        'args' => array(
+          'url' => '',
+          'title' => '',
+          'message' => '',
+          'summary' => '',
+          'provider' => 'facebook',
+        ),
+      ),
+    ),
+    'rpx_social_icons' => array(
+      'variables' => array(
+        'args' => array(),
+        'providers' => array(),
+      ),
     ),
-    'rpx_share_button' => array('node' => NULL),
-    'rpx_social_icons' => array(),
   );
 }
 
@@ -401,13 +454,14 @@ function rpx_widgets_node_view($node, $view_mode) {
   }
 
   // Should we attach to teasers?
-  if($view_mode == 'teaser' && !variable_get('rpx_attach_share_link_to_teasers_'. $node->type, FALSE))
+  if ($view_mode == 'teaser' && !variable_get('rpx_attach_share_link_to_teasers_'. $node->type, FALSE)) {
     return;
+  }
 
   // Attach to node links section.
   if (variable_get('rpx_attach_share_link_to_nodelink_'. $node->type, FALSE)) {
-	$node->content['links']['#links']['rpx_share_button'] = array(
-      'title' => _rpx_share_button($node),
+	 $node->content['links']['#links']['rpx_share_button'] = array(
+      'title' => _rpx_share_button($node, TRUE),
       'html' => TRUE,
     );
   }
@@ -424,7 +478,7 @@ function rpx_widgets_node_view($node, $view_mode) {
 /**
  * Returns HTML markup for the social sharing button.
  */
-function _rpx_share_button($node) {
+function _rpx_share_button($node, $hide_icons = FALSE) {
   global $user;
   // Prepare arguments for RPXNOW.Social.Activity().
   $args = array();
@@ -437,35 +491,14 @@ function _rpx_share_button($node) {
   }
   $args['summary'] = addslashes(text_summary(strip_tags($args['summary']), NULL, 128) . '...');
   $args['url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . request_uri();
-  //$args['text'] = 'Reccomend';
-  
-  // Pass node sharing info to social JS.
-  //
-  $settings = array();
-  // Arguments for RPXNOW.Social.Activity().
-  $settings['rpx']['rpx-link-social-node-'. $node->nid]['post'] = array(
-    'label' => $args['label'],
-    'link' => $args['url'],
-    'comment' => $args['message'],
-    'summary' => $args['summary'],
-    'title' => $args['title'],
-  );
-  // Sharing cookie info (used in Rules integration).
-  if (module_exists('rpx_rules') && _rpx_event_enabled('rpx_social_cookie_set_node')) {
-    // For some reason this plugin is not added for Chrome (and maybe others).
-    drupal_add_library('system', 'jquery.cookie');
+  $args['entity_type'] = 'node';
+  $args['entity_id'] = $node->nid;
 
-    // Instruct social JS to set a cookie and trigger a page reload so that an
-    // Engage social sharing Rules event can be fired.
-    $settings['rpx']['rpx-link-social-node-'.$node->nid]['cookie'] = array(
-      'type' => 'node',
-      'id' => $node->nid,
-    );
+  if ($hide_icons) {
+    $args['icons'] = null;
   }
-  drupal_add_js($settings, 'setting');
 
-  rpx_js_social();
-  return theme('rpx_share_button', array('args'=> $args, 'node' => $node));
+  return theme('rpx_share_button', array('args'=> $args, 'text' => $args['label']));
 }
 
 /**
