More refactoring, csv support & make it possible to query experiments in progress via api

I should use smaller commits.

Worth pulling this in quickly because it makes changes that affect the UI. The POST /experiments/ endpoint now returns a Location header and json with a location field. The UI can use this URL to poll the ongoing experiment as it runs. I modified the UI code with this in mind. Should make the continuous graph of live experiment story easier, and it made the code simpler (reduced duplication between cmdline.go and server.go).