some refactoring and getting socket.io to work with browser-sync
further refining socket.io to work alongside browsersync