refactoring social.js and related interface, write a python mock.