fix code violation
added underscore.js
remove dead code
fix socket errors