tests: use random port

Make it possible to run the tests at the same time as the development
server.
Formatting
index: remove cruft

Can we please get into the habit of removing (rather than commenting
out) unused code? That's what version control is for.