Fix database config for analysis script.
Add spread csv generation to analysis.