changed database schema to support analysis modules
fixed broken results gathering logic