updated to local libraries
split into separate js file and added websockets client