Lint the ts-sockets.js code a bit

To bring some clarity. This by no means addresses all the
complaints for jslint, notably its desire for use strict.