diff --git a/lib/js/test/test-jq.js b/lib/js/test/test-jq.js
index 64608fe..23ed60f 100644
--- a/lib/js/test/test-jq.js
+++ b/lib/js/test/test-jq.js
@@ -1,158 +1,158 @@
-﻿/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- /* jshint -W100 */
- 
-/*
- * JavaScript test suite for ThriftTest.thrift. These tests
- * will run only with jQuery (-gen js:jquery) Apache Thrift 
- * interfaces. To create client code:
- *      $ thrift -gen js:jquery ThriftTest.thrift
- *
- * See also:
- * ++ test.js for generic tests  
- * ++ test-nojq.js for "-gen js" only tests
- */
-
-
-//////////////////////////////////
-//jQuery asynchronous tests
-jQuery.ajaxSetup({ timeout: 0 });
-$(document).ajaxError( function() { QUnit.start(); } );
-
-module("jQ Async Manual");
-
-  test("testI32", function() {
-    expect( 2 );
-    QUnit.stop();
-
-    var transport = new Thrift.Transport();
-    var protocol  = new Thrift.Protocol(transport);
-    var client    = new ThriftTest.ThriftTestClient(protocol);
-
-    var jqxhr = jQuery.ajax({
-      url: "/service",
-      data: client.send_testI32(Math.pow(-2,31)),
-      type: "POST",
-      cache: false,
-      dataType: "text",
-      success: function(res){
-        transport.setRecvBuffer( res );
-        equal(client.recv_testI32(), Math.pow(-2,31));
-      },
-      error: function() { ok(false); },
-      complete: function() {
-        ok(true);
-        QUnit.start();
-      }
-    });
-  });
-
-  test("testI64", function() {
-    expect( 2 );
-    QUnit.stop();
-
-    var transport = new Thrift.Transport();
-    var protocol  = new Thrift.Protocol(transport);
-    var client    = new ThriftTest.ThriftTestClient(protocol);
-
-    jQuery.ajax({
-      url: "/service",
-      //This is usually 2^61 but JS cannot represent anything over 2^52 accurately
-      data: client.send_testI64(Math.pow(-2,52)),
-      type: "POST",
-      cache: false,
-      dataType: "text",
-      success: function(res){
-        transport.setRecvBuffer( res );
-        //This is usually 2^61 but JS cannot represent anything over 2^52 accurately
-        equal(client.recv_testI64(), Math.pow(-2,52));
-      },
-      error: function() { ok(false); },
-      complete: function() {
-        ok(true);
-        QUnit.start();
-      }
-    });
-  });
-
-
-module("jQ Async");
-  test("I32", function() {
-    expect( 3 );
-
-    QUnit.stop();
-    client.testI32(Math.pow(2,30), function(result) {
-      equal(result, Math.pow(2,30));
-      QUnit.start();
-    });
-
-    QUnit.stop();
-    var jqxhr = client.testI32(Math.pow(-2,31), function(result) {
-      equal(result, Math.pow(-2,31));
-    });
-
-    jqxhr.success(function(result) {
-      equal(result, Math.pow(-2,31));
-      QUnit.start();
-    });
-  });
-
-  test("I64", function() {
-    expect( 4 );
-
-    QUnit.stop();
-    //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
-    client.testI64(Math.pow(2,52), function(result) {
-      equal(result, Math.pow(2,52));
-      QUnit.start();
-    });
-
-    QUnit.stop();
-    //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
-    client.testI64(Math.pow(-2,52), function(result) {
-      equal(result, Math.pow(-2,52));
-    })
-    .error( function(xhr, status, e) {  ok(false, e.message); } )
-    .success(function(result) {
-      //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
-      equal(result, Math.pow(-2,52));
-    })
-    .complete(function() {
-      ok(true);
-      QUnit.start();
-    });
-  });
-
-  test("Xception", function() {
-    expect( 2 );
-
-    QUnit.stop();
-
-    var dfd = client.testException("Xception", function(result) {
-      ok(false);
-      QUnit.start();
-    })
-    .error(function(xhr, status, e){
-      equal(e.errorCode, 1001);
-      equal(e.message, "Xception");
-      //QUnit.start();
-      //Note start is not required here because:
-      //$(document).ajaxError( function() { QUnit.start(); } );
-    });
-  });
+﻿/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ /* jshint -W100 */
+
+/*
+ * JavaScript test suite for ThriftTest.thrift. These tests
+ * will run only with jQuery (-gen js:jquery) Apache Thrift
+ * interfaces. To create client code:
+ *      $ thrift -gen js:jquery ThriftTest.thrift
+ *
+ * See also:
+ * ++ test.js for generic tests
+ * ++ test-nojq.js for "-gen js" only tests
+ */
+
+
+//////////////////////////////////
+//jQuery asynchronous tests
+jQuery.ajaxSetup({ timeout: 0 });
+$(document).ajaxError( function() { QUnit.start(); } );
+
+module("jQ Async Manual");
+
+  test("testI32", function() {
+    expect( 2 );
+    QUnit.stop();
+
+    var transport = new Thrift.Transport();
+    var protocol  = new Thrift.Protocol(transport);
+    var client    = new ThriftTest.ThriftTestClient(protocol);
+
+    var jqxhr = jQuery.ajax({
+      url: "/service",
+      data: client.send_testI32(Math.pow(-2,31)),
+      type: "POST",
+      cache: false,
+      dataType: "text",
+      success: function(res){
+        transport.setRecvBuffer( res );
+        equal(client.recv_testI32(), Math.pow(-2,31));
+      },
+      error: function() { ok(false); },
+      complete: function() {
+        ok(true);
+        QUnit.start();
+      }
+    });
+  });
+
+  test("testI64", function() {
+    expect( 2 );
+    QUnit.stop();
+
+    var transport = new Thrift.Transport();
+    var protocol  = new Thrift.Protocol(transport);
+    var client    = new ThriftTest.ThriftTestClient(protocol);
+
+    jQuery.ajax({
+      url: "/service",
+      //This is usually 2^61 but JS cannot represent anything over 2^52 accurately
+      data: client.send_testI64(Math.pow(-2,52)),
+      type: "POST",
+      cache: false,
+      dataType: "text",
+      success: function(res){
+        transport.setRecvBuffer( res );
+        //This is usually 2^61 but JS cannot represent anything over 2^52 accurately
+        equal(client.recv_testI64(), Math.pow(-2,52));
+      },
+      error: function() { ok(false); },
+      complete: function() {
+        ok(true);
+        QUnit.start();
+      }
+    });
+  });
+
+
+module("jQ Async");
+  test("I32", function() {
+    expect( 3 );
+
+    QUnit.stop();
+    client.testI32(Math.pow(2,30), function(result) {
+      equal(result, Math.pow(2,30));
+      QUnit.start();
+    });
+
+    QUnit.stop();
+    var jqxhr = client.testI32(Math.pow(-2,31), function(result) {
+      equal(result, Math.pow(-2,31));
+    });
+
+    jqxhr.success(function(result) {
+      equal(result, Math.pow(-2,31));
+      QUnit.start();
+    });
+  });
+
+  test("I64", function() {
+    expect( 4 );
+
+    QUnit.stop();
+    //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
+    client.testI64(Math.pow(2,52), function(result) {
+      equal(result, Math.pow(2,52));
+      QUnit.start();
+    });
+
+    QUnit.stop();
+    //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
+    client.testI64(Math.pow(-2,52), function(result) {
+      equal(result, Math.pow(-2,52));
+    })
+    .error( function(xhr, status, e) {  ok(false, e.message); } )
+    .success(function(result) {
+      //This is usually 2^60 but JS cannot represent anything over 2^52 accurately
+      equal(result, Math.pow(-2,52));
+    })
+    .complete(function() {
+      ok(true);
+      QUnit.start();
+    });
+  });
+
+  test("Xception", function() {
+    expect( 2 );
+
+    QUnit.stop();
+
+    var dfd = client.testException("Xception", function(result) {
+      ok(false);
+      QUnit.start();
+    })
+    .error(function(xhr, status, e){
+      equal(e.errorCode, 1001);
+      equal(e.message, "Xception");
+      //QUnit.start();
+      //Note start is not required here because:
+      //$(document).ajaxError( function() { QUnit.start(); } );
+    });
+  });
diff --git a/lib/js/test/testws.html b/lib/js/test/testws.html
index 15ee195..2e9f786 100644
--- a/lib/js/test/testws.html
+++ b/lib/js/test/testws.html
@@ -1,60 +1,60 @@
-﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-  <title>Thrift Javascript Bindings: Unit Test</title>
-
-  <script src="build/js/thrift.js"         type="text/javascript" charset="utf-8"></script>
-  <script src="gen-js/ThriftTest_types.js" type="text/javascript" charset="utf-8"></script>
-  <script src="gen-js/ThriftTest.js"       type="text/javascript" charset="utf-8"></script>
-
-  <!-- jQuery -->
-  <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.2.js" charset="utf-8"></script>
-  
-  <!-- QUnit Test framework-->
-  <script type="text/javascript" src="https://code.jquery.com/qunit/qunit-1.14.0.js" charset="utf-8"></script>
-  <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.14.0.css" type="text/css" media="screen" />
-  
-  <!-- the Test Suite-->
-  <script>
-    var loc = window.location;
-    var ws_uri = ((loc.protocol === "https:") ? "wss://" : "ws://") + 
-                   loc.hostname + ":" + loc.port + loc.pathname;
-    var transport = new Thrift.TWebSocketTransport(ws_uri);
-    var protocol  = new Thrift.Protocol(transport);
-    var client    = new ThriftTest.ThriftTestClient(protocol);
-    transport.open();
-  </script>
-  <script type="text/javascript" src="test-async.js" charset="utf-8"></script>
-</head>
-<body>
-  <h1 id="qunit-header">Thrift Javascript Bindings: Unit Test (<a href="https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob;f=test/ThriftTest.thrift;hb=HEAD">ThriftTest.thrift</a>)</h1>
-  <h2 id="qunit-banner"></h2>
-  <div id="qunit-testrunner-toolbar"></div> 
-  <h2 id="qunit-userAgent"></h2>
-  <ol id="qunit-tests"><li><!-- get valid xhtml strict--></li></ol>
-  <p>
-      <a href="http://validator.w3.org/check/referer"><img
-          src="http://www.w3.org/Icons/valid-xhtml10"
-          alt="Valid XHTML 1.0!" height="31" width="88" /></a>
-  </p>
-</body>
-</html>
+﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>Thrift Javascript Bindings: Unit Test</title>
+
+  <script src="build/js/thrift.js"         type="text/javascript" charset="utf-8"></script>
+  <script src="gen-js/ThriftTest_types.js" type="text/javascript" charset="utf-8"></script>
+  <script src="gen-js/ThriftTest.js"       type="text/javascript" charset="utf-8"></script>
+
+  <!-- jQuery -->
+  <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.2.js" charset="utf-8"></script>
+
+  <!-- QUnit Test framework-->
+  <script type="text/javascript" src="https://code.jquery.com/qunit/qunit-1.14.0.js" charset="utf-8"></script>
+  <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.14.0.css" type="text/css" media="screen" />
+
+  <!-- the Test Suite-->
+  <script>
+    var loc = window.location;
+    var ws_uri = ((loc.protocol === "https:") ? "wss://" : "ws://") +
+                   loc.hostname + ":" + loc.port + loc.pathname;
+    var transport = new Thrift.TWebSocketTransport(ws_uri);
+    var protocol  = new Thrift.Protocol(transport);
+    var client    = new ThriftTest.ThriftTestClient(protocol);
+    transport.open();
+  </script>
+  <script type="text/javascript" src="test-async.js" charset="utf-8"></script>
+</head>
+<body>
+  <h1 id="qunit-header">Thrift Javascript Bindings: Unit Test (<a href="https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob;f=test/ThriftTest.thrift;hb=HEAD">ThriftTest.thrift</a>)</h1>
+  <h2 id="qunit-banner"></h2>
+  <div id="qunit-testrunner-toolbar"></div>
+  <h2 id="qunit-userAgent"></h2>
+  <ol id="qunit-tests"><li><!-- get valid xhtml strict--></li></ol>
+  <p>
+      <a href="http://validator.w3.org/check/referer"><img
+          src="http://www.w3.org/Icons/valid-xhtml10"
+          alt="Valid XHTML 1.0!" height="31" width="88" /></a>
+  </p>
+</body>
+</html>
