Code cleaning

Code cleaning : 
   * Remove line with more than 80 caracteres
   * Add comments
   * Create sub-functions
   * Put environment variable in uppercase

Adding : 
   * Possibility to have permissions on all docType. In package.json : 


         permissions: {
             "All":{
                 "description": ....
                 }
          }