Move sock JS code into its own file.