Try to make main thread async. Refactor modules further. Fixup more logging