Split the analysis output into separate files when saving results.

Also, try to make the analysis logging a little smarter.