Reconnects to server after 5 seconds of delay fix #18
Added a ajax call in socket close method to test if the server is up and running before reloading the page
added an error handler in ajax call which would call the refresh function fix #18
Minor tweak to functionality to simplify it and remove one of the setTimeouts. Also removed the vestigal clearInterval call and related variable.
Merge pull request #78 from drewww/client-reconnect

Client reconnect