Rewrite ReconnectingWebSocket in TypeScript.

The JavaScript, minified JavaScript and SourceMap
files are generated from the TypeScript using Grunt.