diff --git a/rsapublickey/rsapublickey.test b/rsapublickey/rsapublickey.test
index 68a8710..42c2133 100644
--- a/rsapublickey/rsapublickey.test
+++ b/rsapublickey/rsapublickey.test
@@ -1,5 +1,8 @@
 <?php
-// $Id:  $
+/**
+ * @file
+ * Test RSA public key fields and widgets
+ */
 
 class RsapublickeyFieldTestCase extends DrupalWebTestCase {
   protected $instance;
diff --git a/webidauth.info b/webidauth.info
index dab2773..e955d0d 100644
--- a/webidauth.info
+++ b/webidauth.info
@@ -4,3 +4,11 @@ package = Authentication
 core = 7.x
 dependencies[] = libraries
 configure = admin/config/people/webidauth
+files[] = webidauth.module
+files[] = webidauth.parser.inc
+files[] = webidauth.pages.inc
+scripts[] = webidauth.js
+scripts[] = tls_logout.js
+stylesheets[all][] = webidauth.css
+stylesheets[all][] = webidauth-rtl.css
+
diff --git a/webidauth.install b/webidauth.install
index ea7325b..1e4832d 100644
--- a/webidauth.install
+++ b/webidauth.install
@@ -24,11 +24,11 @@ function webidauth_schema() {
    $schema['webidauth'] = array(
       'description' => 'Stores the asociations between users and WebIDs.' ,
       'fields' => array(
-      	'wid' => array(
+        'wid' => array(
             'type' => 'serial',
             'not null' => TRUE,
             'description' => 'Primary key: Unique identifier for a WebID asociation',
-      	  ),
+          ),
          'uri' => array(
             'type' => 'varchar',
             'length' => 5000,
@@ -78,7 +78,7 @@ function webidauth_requirements($phase) {
         'value' => t('Not installed'),
         'severity' => REQUIREMENT_ERROR,
         'description' => t('WebIDauth requires the use of the <a href="@libauth">libAuthentication library</a>.', array('@libauth' => 'https://github.com/WebIDauth/libAuthentication')),
-        'title'=>t('libAuthentication library')
+        'title' => t('libAuthentication library')
       );
     }
     if (!class_exists('ARC2')) {
@@ -86,7 +86,7 @@ function webidauth_requirements($phase) {
         'value' => t('Not installed'),
         'severity' => REQUIREMENT_ERROR,
         'description' => t('WebIDauth requires the use of the <a href="@arc">ARC library</a>.', array('@arc' => 'https://github.com/semsol/arc2/')),
-        'title'=>t('ARC library')
+        'title' => t('ARC library')
       );
     }
     if (!class_exists('Graphite')) {
@@ -94,7 +94,7 @@ function webidauth_requirements($phase) {
         'value' => t('Not installed'),
         'severity' => REQUIREMENT_ERROR,
         'description' => t('WebIDauth requires the use of the <a href="@graphite">Graphite RDF library</a>.', array('@graphite' => 'http://graphite.ecs.soton.ac.uk/')),
-        'title'=>t('Graphite RDF library')
+        'title' => t('Graphite RDF library')
       );
     }
 
@@ -107,8 +107,8 @@ function webidauth_requirements($phase) {
 
 
 
-function webidauth_update_7100(){
-   db_drop_field('webidauth','modulus');
+function webidauth_update_7100() {
+   db_drop_field('webidauth', 'modulus');
    return 'Removed redundant modulus field';
 
 }
diff --git a/webidauth.module b/webidauth.module
index 59450c6..e931d4b 100644
--- a/webidauth.module
+++ b/webidauth.module
@@ -90,9 +90,9 @@ function _webid_auth_access($uid_arg) {
     if ($uid_arg->uid === $user->uid)
         return TRUE;
     else
-      if(isset($uid_arg->uid) && isset($user->uid))
+      if (isset($uid_arg->uid) && isset($user->uid))
         return user_access('modify webidauth identities') && user_edit_access($uid_arg);
-      else return false;
+      else return FALSE;
 
 
 }
@@ -175,8 +175,7 @@ function webidauth_user_delete($account) {
  * Implements hook_form_FORM_ID_alter().
  */
 
-function webidauth_form_user_login_block_alter(&$form, &$form_state)
-{
+function webidauth_form_user_login_block_alter(&$form, &$form_state) {
     _webidauth_user_login_form_alter($form, $form_state);
 }
 
@@ -333,7 +332,8 @@ function webidauth_admin_user_register_validate(&$form, &$form_state) {
         if ($form_state['values']['foaf_uri'] === '') {
             form_set_error('pass', t('You must either enter a valid password or provide a FOAF URI.'));
             form_set_error('foaf_uri', t('You must either enter a valid password or provide a FOAF URI.'));
-        } else {
+        } 
+        else {
             $form_state['values']['pass'] = user_password();
         }
     }
@@ -405,7 +405,8 @@ function webidauth_form_user_register_form_alter(&$form, &$form_state) {
         if (!empty($username)) {
 
             $form['account']['name']['#default_value'] = $username;
-        } else {
+        } 
+        else {
             $form['account']['name']['#default_value'] = '';
         }
 
@@ -426,7 +427,8 @@ function webidauth_form_user_register_form_alter(&$form, &$form_state) {
         $form['webidauth_display'] = array('#type' => 'item', '#title' => t('Your WebID'),
             '#description' => t('This WebID will be attached to your account after registration.'),
             '#markup' => check_plain($uri), );
-    } else {
+    } 
+    else {
         if (user_access('administer users') !== TRUE)
             return;
         $form['account']['foaf_uri'] = array('#type' => 'textfield', '#title' => t('Foaf URI'),
@@ -504,10 +506,11 @@ function _webidauth_exists($claimed_uri) {
 
     $user_obj = $user_data->execute()->fetchObject();
     if ($user_obj !== FALSE) {
-
-        return $user_obj;
-    } else
-        return FALSE;
+      return $user_obj;
+    }
+    else {
+      return FALSE;
+    }
 }
 
 /**
diff --git a/webidauth.pages.inc b/webidauth.pages.inc
index 5f7021d..a8821dc 100644
--- a/webidauth.pages.inc
+++ b/webidauth.pages.inc
@@ -18,8 +18,7 @@
 /**
  * Menu callback; Manage WebID identities for the specified user.
  */
-function webidauth_user_identities($account)
-{
+function webidauth_user_identities($account) {
     global $user;
     drupal_set_title(format_username($account));
     drupal_add_css(drupal_get_path('module', 'webidauth') . '/webidauth.css');
@@ -55,12 +54,10 @@ function webidauth_user_identities($account)
  *
  * @return
  */
-function webidauth_add_page()
-{
-
-    global $user;
+function webidauth_add_page() {
+  global $user;
   $pubkey = array(variable_get('webidauth_auth_server_certificate', DEFAULT_WEBID_VALIDATOR_CERTIFICATE));
-  $auth = new Authentication_FoafSSLDelegate(false,NULL,NULL,new Authentication_X509CertRepo($pubkey));
+  $auth = new Authentication_FoafSSLDelegate(false, NULL, NULL, new Authentication_X509CertRepo($pubkey));
     if (isset($_REQUEST['error'])) {
         if ($_REQUEST['error'] === 'noVerifiedWebId')
             drupal_set_message(t('The provided WebID could not be verified.'), 'error');
@@ -69,40 +66,33 @@ function webidauth_add_page()
         $uri = $_REQUEST['webid'];
         if ($uri) {
             $u = _webidauth_exists($uri);
-            if ($u !== false) {
+            if ($u !== FALSE) {
 
                 drupal_set_message(t('The claimed WebID is already used by another user. Please
                 contact ' . variable_get('site_name') . ' administrator.'),
                     'warning');
                 drupal_goto('user/' . $user->uid . '/webidauth/');
-
-            } else {
-
-
+            } 
+            else {
                 _webidauth_save( $uri, $user->uid);
 
                 drupal_set_message(t('The WebID was successfully associated with your account.'));
                 drupal_goto('user/' . $user->uid . '/webidauth/');
             }
-
         }
     }
-
 }
 
 
 /**
- * Menu callback; Authenticate with a  WebID identity for the logged in user.
+ * Menu callback; Authenticate with a WebID identity for the logged in user.
  *
  * @return
  */
-function webidauth_authentication_page()
-{
-
+function webidauth_authentication_page() {
     global $user;
     $pubkey = array(variable_get('webidauth_auth_server_certificate', DEFAULT_WEBID_VALIDATOR_CERTIFICATE));
-    $auth = new Authentication_FoafSSLDelegate(false,NULL,NULL,new Authentication_X509CertRepo($pubkey));
-
+    $auth = new Authentication_FoafSSLDelegate(false, NULL, NULL, new Authentication_X509CertRepo($pubkey));
 
     if (isset($_REQUEST['error'])) {
         if ($_REQUEST['error'] === 'noVerifiedWebId' ||$_REQUEST['error']==='certNoOwnership' )
@@ -117,26 +107,26 @@ function webidauth_authentication_page()
     if (user_is_logged_in())
         return;
 
-    if ($auth->isAuthenticated()) {//successful WebID validation
+    if ($auth->isAuthenticated()) {
+      //successful WebID validation
         $uri = $_REQUEST['webid'];
         if ($uri) {
             $foaf = new FoafParser($uri);
 
             $u = _webidauth_exists($uri);
-            if ($u !== false) {
+            if ($u !== FALSE) {
 
                 user_external_login_register(trim($u->name), 'webidauth');
                 drupal_goto('<front>');
-
-
-            } else {//create the account with the username & email if they don't already exist, else go to register page
-
+            } 
+            else {
+              //create the account with the username & email if they don't already exist, else go to register page
                 $existing_user_data = db_select('users', 'u');
                 $existing_user_data->fields('u', array('name'))->condition(db_or()->condition('u.name', trim($foaf->getName()),
                     '=')->condition('u.mail', $email, '='));
 
                 $existing_user_obj = $existing_user_data->execute()->fetchObject();
-                if ($existing_user_obj !== false ||
+                if ($existing_user_obj !== FALSE ||
                      (trim($foaf->getName())== '' || trim($foaf->getMailbox())== '')
                 ) {
                     $_SESSION['foaf'] = $uri;
@@ -146,32 +136,23 @@ function webidauth_authentication_page()
                 else{
 
                     user_external_login_register(trim($foaf->getName()), 'webidauth');
-                    if(user_is_logged_in()){
-                        _webidauth_save($uri,$user->uid);
+                    if (user_is_logged_in()) {
+                        _webidauth_save($uri, $user->uid);
                         $user->mail = trim($foaf->getMailbox());
                         user_save($user);
                     }
                     drupal_goto('<front>');
-
                 }
-
-
-
-
             }
-
         }
-
     }
-
 }
 
 
 /**
  * Menu callback; Add a WebID identity for the specified user.
  */
-function admin_webidauth_user_add()
-{
+function admin_webidauth_user_add() {
     $form['webidauth_identifier'] = array('#type' => 'textfield', '#title' => t('WebID FOAF-Profile URL'), );
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Add a WebID'));
@@ -185,29 +166,24 @@ function admin_webidauth_user_add()
  * @param mixed $form_state
  * @return
  */
-function admin_webidauth_user_add_submit($form, &$form_state)
-{
-    $return_to = url('user/' . arg(1) . '/webidauth/', array('absolute' => true));
+function admin_webidauth_user_add_submit($form, &$form_state) {
+    $return_to = url('user/' . arg(1) . '/webidauth/', array('absolute' => TRUE));
     $uri = $form_state['values']['webidauth_identifier'];
     if ($uri) {
 
 
         $u = _webidauth_exists($uri);
-        if ($u !== false) {
+        if ($u !== FALSE) {
             drupal_set_message(t('The claimed WebID is already used by another user. Please
              review user <a href="user/' . $u->uid . '/webidauth/">' . $u->name .
                 '</a> before continuing.'), 'warning');
-
-        } else {
-
-
+        } 
+        else {
             _webidauth_save($uri, arg(1));
             drupal_set_message(t('The WebID was successfully associated with the selected account.'));
             drupal_goto('user/' . arg(1) . '/webidauth/');
         }
-
     }
-
 }
 
 /**
@@ -216,9 +192,7 @@ function admin_webidauth_user_add_submit($form, &$form_state)
  * @ingroup forms
  * @see webid_user_add_validate()
  */
-function webidauth_user_add()
-{
-
+function webidauth_user_add() {
     $form['actions'] = array('#type' => 'actions');
     $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Add a WebID'));
     return $form;
@@ -228,9 +202,8 @@ function webidauth_user_add()
 /**
  * submit hook for the webidauth_user_add form
  */
-function webidauth_user_add_submit($form, &$form_state)
-{
-    $return_to = url('user/' . arg(1) . '/webidauth/add', array('absolute' => true));
+function webidauth_user_add_submit($form, &$form_state) {
+    $return_to = url('user/' . arg(1) . '/webidauth/add', array('absolute' => TRUE));
     //$return_to = url('user/' . arg(1) . '/webidauth/', array('absolute' => true));
 
     global $base_url;
@@ -240,8 +213,7 @@ function webidauth_user_add_submit($form, &$form_state)
 /**
  * Menu callback; Delete the specified WebID identity from the system.
  */
-function webidauth_user_delete_form($form, $form_state, $account, $wid = 0)
-{
+function webidauth_user_delete_form($form, $form_state, $account, $wid = 0) {
 
     $user_data = db_select('webidauth', 'w');
 
@@ -265,8 +237,7 @@ function webidauth_user_delete_form($form, $form_state, $account, $wid = 0)
 /**
  * submit hook for the webidauth_user_delete form
  */
-function webidauth_user_delete_form_submit($form, &$form_state)
-{
+function webidauth_user_delete_form_submit($form, &$form_state) {
 
     $query = db_delete('webidauth')->condition('uid', $form_state['build_info']['args'][0]->
         uid)->condition('wid', $form_state['build_info']['args'][1])->execute();
diff --git a/webidauth.parser.inc b/webidauth.parser.inc
index 208f3e3..c2f6e50 100644
--- a/webidauth.parser.inc
+++ b/webidauth.parser.inc
@@ -9,17 +9,20 @@
  *      Charalampos Bratsas
  *      Dimitris Spachos
  */
+ 
+/**
+ * @file
+ * FoafParser for Drupal
+ */
 
-class FoafParser
-{
+class FoafParser {
     /**
      * FoafParser::__construct()
      * Constructs a new instance of the FoafParser class
      * @param mixed $uri
      * @return
      */
-    public function __construct($uri)
-    {
+    public function __construct($uri) {
         $this->graphite = new Graphite();
                 $this->graphite->ns("cert", "http://www.w3.org/ns/auth/cert#");
                 $this->graphite->ns("rsa", "http://www.w3.org/ns/auth/rsa#");
@@ -35,8 +38,7 @@ class FoafParser
      * Returns the name of the person described in the foaf profile
      * @return
      */
-    public function getName()
-    {
+    public function getName() {
         return (string )$this->graphite->resource($this->uri)->get("foaf:nick");
     }
 
@@ -45,8 +47,7 @@ class FoafParser
      * Returns the image url of the person described in the foaf profile
      * @return
      */
-    public function getImage()
-    {
+    public function getImage() {
         return (string )$this->graphite->resource($this->uri)->get("foaf:img");
     }
 
@@ -55,8 +56,7 @@ class FoafParser
      * Returns the email address of the person described in the foaf profile
      * @return
      */
-    public function getMailbox()
-    {
+    public function getMailbox() {
         $prefix = 'mailto:';
         $mbox = (string )$this->graphite->resource($this->uri)->get("foaf:mbox");
 
@@ -65,9 +65,6 @@ class FoafParser
         if (substr($mbox, 0, strlen($prefix) ) == $prefix) {
             $mbox = substr($mbox, strlen($prefix), strlen($mbox) );
         }
-
-
         return $mbox ;
     }
-
 }
