added jquery and refactored out client and server side files, socket into a class