Pulled out Server JS code into its own file.