Fixed failure when running from working directory that isn't the directory containing server.js.

It now does a chdir to the script directory, so all the relative paths still work.