added verbose option to webui.js
added locks to sockets for sending data to prevent collision between gthreads