Move social scripts in social.js and improve performance