Multithreading fixes. Started coding log analysis etc, enhanced db schema. Cosmetic fixes.